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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Set Analysis help

Hello:

I've this data:

Offer No.OrderStatusDate D/M/YAmount
11Requested01/01/20130
12Delivered01/02/2013200
13Accepted01/05/2013200
21Requested01/01/20130
22Delivered01/02/20131000
23Lost01/05/20131000
31Requested01/01/20130
32Delivered01/02/20131000
33Delivered01/05/2013800
34Delivered01/07/2013750
35Accepted01/08/2013750

and this expressions:

sum( { < Status = {'Delivered'} > }  Amount )

sum( { < Status = {'Accepted'}  > }  Amount )

sum( { < Status = {'Lost'} > }  Amount )

the results are the expected.

The problem is that I need to change the "Delivered" expresion to get only the last version of all status of each order.

Now for the Offer No 3, delivered amount is 2550 but the correct sum is 750

Please, could you help me to correct this expression: sum( { < Status = {'Delivered'} > }  Amount )

Thank you

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

FirstSortedValue({<Status = {'Delivered'}>}Amount, -[Date D/M/Y])

in a table with dimension  Offer No. or, if you need a total line for that expression:

sum(aggr(

     FirstSortedValue({<Status = {'Delivered'}>}Amount, -[Date D/M/Y])

,[Offer No.]))

View solution in original post

2 Replies
swuehl
MVP
MVP

Try

FirstSortedValue({<Status = {'Delivered'}>}Amount, -[Date D/M/Y])

in a table with dimension  Offer No. or, if you need a total line for that expression:

sum(aggr(

     FirstSortedValue({<Status = {'Delivered'}>}Amount, -[Date D/M/Y])

,[Offer No.]))

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II
Author

Thank you very much, swuehl

I just used both with and without totals