Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
DataHashira
Contributor II
Contributor II

How ot pick the id with the lasted date

DataHashira_0-1671478567193.png

 

I tried everything, set analysis, aggr but i don't know where I'm going wrong

Labels (4)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

use firstSortedValue(), as below

 

=firstSortedValue(ID,-Date)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

8 Replies
AronC
Partner - Creator II
Partner - Creator II

Why not just Max(Date)?

I.e, first column: Id, second column: max(Date) as expression 

 

vinieme12
Champion III
Champion III

use firstSortedValue(), as below

 

=firstSortedValue(ID,-Date)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
DataHashira
Contributor II
Contributor II
Author

i tried but when i put more dimensions the id return more than one values

DataHashira
Contributor II
Contributor II
Author

i tried but when i put more dimensions the id return more than one values

vinieme12
Champion III
Champion III

Can you please post the expression you tried ?

Are you trying this in chart or data load editor?

The expression I provided is for chart usage

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
AronC
Partner - Creator II
Partner - Creator II

If you have more columns please attached the whole scenario.

 

AronC
Partner - Creator II
Partner - Creator II

@DataHashira Do you have to solve it frontend.

Otherwise in backend you could just flag the rows with latest date. Then your set-expression would be very smooth.

left join(Orgiginal_Table)
ID,
max(Date) as Date,
1 as _LatestDate
resident Orgiginal_Table
group by ID;

 

DataHashira
Contributor II
Contributor II
Author

Now i use the expression as a dimension and work it!