Coming soon: We’re working on a brand new, revamped Community experience. Want to receive updates? Sign up now!

0 votes
I have a database with a unique ID identifier for each row/record. Rows are created by dates.

For example, say I have 3 rows for borrower #1 for April 1, May 1, and June 1 and their respective rating.

April 1 = A2

May 1 = A1

June 1 = A1


How would I be able to create a column that would identify if the rating has changed from the previous month? So April 1 = no, May 1 = Yes, June 1 = No.


Any help would be appreciated. Thanks.

2 Answers

+1 vote
Best answer

If you don't want to code, you have these two recipes that can help you:

  • distinct : to make sure that you have a unique row per month per ID
  • windows : can help with many things, in particular can help you to retrieve the previous value (LAG) in a partition (so you should partition by ID and sort by lonth). To better understand this recipe, have a look at windows functions from the SQL databases.

I hope that will help.

selected by
+1 vote
Hello, This is exactly the purpose of the visual window recipe. Here is an explanation of how to use it : Cheers, Alexandre
1,339 questions
1,365 answers
11,916 users

©Dataiku 2012-2018 - Privacy Policy