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

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
aldo-tgh
Partner - Creator II
Partner - Creator II

FirstSortedValue with TOTAL by dimension

Hi Guys,

Need help with the following.

my data set has the following fields:  Storekey, Sessionkey, Itemkey, scene_date, and distributed, like:

_StoreKey1 _SessionKey1 scene_dateSum(distributed)
92
25450a07/01/201450
25487c08/01/20144
70479807/01/201422
70402a14/01/201416

I am trying to sum distributed in last scene_date  of each storekey.

In the example attached,

last session for store 254 is on 08/01/2014 the count=4

last session for store 704 is on 14/01/2014 the count=16

I need to be able to create both, a table and a list box, like:

_StoreKey1 # of distributed items Last Session # of distributed items on LAST SESSION
92 20
2545408/01/20144
7043814/01/201416

and also need to show that calculation (green field) into a List Box.

I am trying to use FirstSortedValue, something like:

FirstSortedValue( TOTAL <_StoreKey1,Sessionkey> distributed ,-scene_date)

but getting NULL since there are more than 1 resulting lines for each combination of Store & Session & Scene_Date because of Itemkey.

How do I work it around?

Thanks in advance for any help.

Aldo.

10 Replies
aldo-tgh
Partner - Creator II
Partner - Creator II
Author

Thanks!