Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Aggregated sum by max date

Good day!

I have some source:

   

IdDateSales
115.02.201645
116.02.2016654
215.02.201654
216.02.20161
315.02.201645

I expression i need to calculate Sales by Id. if some Id has more then one Date, expression must get max date.

Thanks.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try FirstSortedValue(Sales, -Date)


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try FirstSortedValue(Sales, -Date)


talk is cheap, supply exceeds demand
sunny_talwar

Implementation of Gysbert's suggestion:

Capture.PNG

Anonymous
Not applicable
Author

Thanks!

Anonymous
Not applicable
Author

Thank you!

Can i use filters inside this expr?

sunny_talwar

You sure can

jolivares
Specialist
Specialist

The expression is:

FirstSortedValue(Sales, -Aggr(Max(Date(Date#(Date,'DD.MM.YYYY'))),Id,Date ))

But you have to take care of your field "Date", is better if you put in the correct format.

sunny_talwar

You can add set analysis to FirstSortedValue function:

FirstSortedValue({<Field = {'Something'}>} Sales, -Date)