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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Janneke
Creator
Creator

Set analysis in set analysis

Hi all,

I have a question regarding set analysis within set analysis. Hope that you can help me.

The data I am using has amounts per customer, stamped every month. For instance:

CUSTOMERMONTHAMOUNT
C-012015076
C-0120150812
C-0120150918
C-02201512100
C-0320151120
C-0320151240

I would like to have a table that shows customer and the last amount, given a certain month. For instance, if I choose 201512:

CUSTOMERAMOUNT
C-0118
C-02100
C-0340

I have come up with this solution:

=Sum({$<Indicator={$(vIndicator)},Type={'Realisation'},YEARMONTH={"$(=Max({$<Indicator={$(vIndicator)},Type={'Realisation'},YEAR={$(vTHIS_YEAR)},MONTH={'<=$(vTHIS_MONTH)'}>}YEARMONTH))"}>}AMOUNT)


Problem with that is that it only shows values for the customers that have 201512 as the last available month:

CUSTOMERAMOUNT
C-010
C-02100
C-0340

This makes sense, since I don't break down to customer. However, I don't know how and where to add the customer to the expression.

Can you please help me find the right syntax for the last step?

Regards, Janneke.

1 Solution

Accepted Solutions
Not applicable

Try first sorted value.

SUM(Firstsortedvalue({<set analysis for amount greater than 0>} amount, -Month))

View solution in original post

4 Replies
Not applicable

Try first sorted value.

SUM(Firstsortedvalue({<set analysis for amount greater than 0>} amount, -Month))

sunny_talwar

Try this expression with CUSTOMER as your dimension:

FirstSortedValue(AMOUNT, -MONTH)

luizcdepaula
Creator III
Creator III

What is the ({<set analysis for amount greater than 0>}?

Thanks,

LD

Janneke
Creator
Creator
Author

It is just the set analysis that you want to use. Nothing particular.