Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max date for all rows

Hi ,

I have a straight table with

ID Orderno endDate

1     1     1/10/2015

1     2     3/10/2015

I want to display this in straight table like below with max date

ID Orderno endDate

1     1     3/10/2015

1     2     3/10/2015

Can you please help me with this logic.

Thanks
karthik

8 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

In the expression, you can use Max(Total [End Date]):

Capture.PNG

Hope this helps.

Not applicable
Author

Hi Sinan,

Thanks for that , it work if we have only 1 id, but if we have multiple ids it does not work

Say

ID Orderno enddate

1      1          1/10/2015

1     2          3/10/2015

2     1          10/10/2015

3      1          11/10/2015

i want the straight table like below

ID Orderno enddate

1      1          3/10/2015

1     2          3/10/2015

2     1          10/10/2015

3      1          11/10/2015

Thanks
Karthik

settu_periasamy
Master III
Master III

Try

=max(TOTAL <ID>enddate)

sinanozdemir
Specialist III
Specialist III

I am not at my computer, but try this Aggr(Max(Enddate), ID)

Thanks

Not applicable
Author

Hi Settu,

Thanks a lot this logic.. it works , but can we do like this if i have selected the max date and need to display its order no in the same field.

For example:

ID Orderno enddate

1      2          1/10/2015

1     1         3/10/2015

2     1          10/10/2015

3      4         11/10/2015

3     2          23/10/2015

i want the data like below

ID Orderno enddate        final_orderno

1      2          1/10/2015     1

1     1         3/10/2015     1

2     1          10/10/2015     1

3      4          11/10/2015     2

3     2              23/10/2015     2

Thanks in advance

Regards

Karthik

settu_periasamy
Master III
Master III

Hi Karthik,

sorry, I didn't get you. What based the "final_orderno" should get arrived?

Not applicable
Author

HI Settu,

based on max(date), we need to get its order no and should populate for each row where the id is same

Thanks
Karthik

settu_periasamy
Master III
Master III

Hi Karthik,

Try this

=if(isnull(if(enddate=Max(TOTAL <ID>enddate),Orderno)),Above(Orderno),if(enddate=Max(TOTAL <ID>enddate),Orderno))

Note: I'm trying to simplify this