Discover the winners & finalists of the 2022 Dataiku Frontrunner Awards!READ THEIR USE CASES

How to filter the max date in the column using prepare recipe

prabhakaran808
Level 1
How to filter the max date in the column using prepare recipe

Hi,

I would like to filter or flag the max date in the column using the prepare recipe.

For example:

Below is my dataset. I would like to filter or flag the max date or latest date in the column "date" and show the relevant  values from other columns like below. 

CodeIDDate 
BT01A2022-04-30T00:00:00.000Z 
BT01d2022-04-30T00:00:00.000Z 
BT01e2022-03-30T00:00:00.000Z 
BT01f2022-04-30T00:00:00.000Z 
BT01g2022-05-30T00:00:00.000Z 
BT01h2022-05-30T00:00:00.000Z 

 

Expected out put:

CodeIDDate
BT01g2022-05-30T00:00:00.000Z
BT01h2022-05-30T00:00:00.000Z

 

Currently i am using the topn recipe to identify the max date and doing Join with the previous dataset to fetch the other columns. Felt this was the long route to achieve this result. requesting for experts comments.

Thanks,

Prabhakaran  

 


Operating system used: Windows

0 Kudos
1 Reply
MiguelangelC
Dataiker

If you know what is the maximum/latest date you are looking for, you can use the "Filter rows/cells on date" processor.

However, if you do not know what is the value of the max on that colum, then the prepare recipe is not the best option. This is because (most of) its processors operate on a row by row basis. The kind of aggregation needed to calculate a max, min, avg, etc is not available for this recipe unless the values are contained in the same row.

Hope this helps.

0 Kudos