Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yvonne-c
Creator
Creator

Sum Value of max date per ID

Hi

I am trying to create a summary table which shows the latest value per ID (Total field is the sum (Count(Head)).  I can show the latest date per ID but only the value for the first ID appears.  Can you help with my expression?

Count({<Date={"$(=Max(Date))"}>}Head)

I guess I need to add per ID in somehow?

Thanks

ms.JPG

1 Solution

Accepted Solutions
sunny_talwar

Or this:

=FirstSortedValue(Aggr(YourExpressionFromTOTALStraightTable, ID, Date), -Aggr(Max(Date), Date))

Replace YourExpressionFromTOTALStraightTable with your actual expression from your the second table in the image

Capture.PNG

I have attached a sample, but the expression in the straight table might not match with yours, but the output should work if you copy paste your expression into the red area mentioned above.

Best,

Sunny

View solution in original post

3 Replies
sunny_talwar

You can try using FirstSortedValue() function here:

=FirstSortedValue(DISTINCT Head, -Date)

sunny_talwar

Or this:

=FirstSortedValue(Aggr(YourExpressionFromTOTALStraightTable, ID, Date), -Aggr(Max(Date), Date))

Replace YourExpressionFromTOTALStraightTable with your actual expression from your the second table in the image

Capture.PNG

I have attached a sample, but the expression in the straight table might not match with yours, but the output should work if you copy paste your expression into the red area mentioned above.

Best,

Sunny

yvonne-c
Creator
Creator
Author

Thanks Sunny, this worked perfectly