Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
BarPinto
Contributor III
Contributor III

Return last date for each id

Hey,

I want to return id last record date.

for example, if i have the table:

 

id       date

2     22/01/2022

3    03/02/2021

5    05/12/2021

2    24/02/2022

9   26/02/2022

 

ill get the table:

id       date

3    03/02/2021

5    05/12/2021

2    24/02/2022

9   26/02/2022

 

how can i return the max date for each id?

 

Labels (7)
1 Solution

Accepted Solutions
EliGohar
Partner - Creator III
Partner - Creator III

@BarPinto Maybe something like this?

FirstSortedValue([job level],-date)

 

This returns the job level by the last date, see the result in a table:

EliGohar_0-1646207359769.png

 

Eli.

View solution in original post

5 Replies
EliGohar
Partner - Creator III
Partner - Creator III

Hi @BarPinto 

Do you mean to retrieve the max date in the sheet (client) or in the data load editor?

If it's for the client - just set the measure Max(date) by id, for example:

EliGohar_0-1645953932269.png

 

Eli.

BarPinto
Contributor III
Contributor III
Author

Thanks! @EliGohar 

yes, retrieve the max date in the sheet.

when i try to add filter to max date, like id status its return the same date for all id.

if i want - max date for each id but show only the id in active status ?

 

thank you!

EliGohar
Partner - Creator III
Partner - Creator III

When filtering and getting the same date for all IDs - might be an issue with the connections between tables? (Data modeling)

Show max date for active id should work with filtering (select only active status) or using set analysis.

 

BarPinto
Contributor III
Contributor III
Author

thank you @EliGohar .

if i have table :

id       date                   job level

2     22/01/2022         A

3    03/02/2021         C

5    05/12/2021         B

2    24/02/2022         D

9   26/02/2022         A

and i want to return the next table:

id      job level

3            C

5            B

2             D

9            A

 

last job level record ( by date) to each id.

how can i do it? for some reason its return me null value

EliGohar
Partner - Creator III
Partner - Creator III

@BarPinto Maybe something like this?

FirstSortedValue([job level],-date)

 

This returns the job level by the last date, see the result in a table:

EliGohar_0-1646207359769.png

 

Eli.