Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

andreyfcdk91
New Contributor III

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

Re: Aggregated sum by max date

Try FirstSortedValue(Sales, -Date)


talk is cheap, supply exceeds demand
7 Replies

Re: Aggregated sum by max date

Try FirstSortedValue(Sales, -Date)


talk is cheap, supply exceeds demand

Re: Aggregated sum by max date

Implementation of Gysbert's suggestion:

Capture.PNG

andreyfcdk91
New Contributor III

Re: Aggregated sum by max date

Thanks!

andreyfcdk91
New Contributor III

Re: Aggregated sum by max date

Thank you!

Can i use filters inside this expr?

Re: Aggregated sum by max date

You sure can

jolivares
Valued Contributor

Re: Aggregated sum by max date

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.

Re: Aggregated sum by max date

You can add set analysis to FirstSortedValue function:

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

Community Browser