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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
joaovieira
Partner - Contributor II
Partner - Contributor II

Set Analysis

Hello community, i am trying to create a KPI that returns the country of the customer that has the more sales, to get the customer i used this expression:

concat(aggr(if(rank(sum({$<Year={'$(vMaxYear)'},OrderDate={'<=$(vMaxDate)'}>}SalesFinal))<2,Customer),Customer),',')

Now the idea is to select the country of the person that the expression returns, any ideas?

Thank you for the help

1 Solution

Accepted Solutions
Mark_Little
Luminary
Luminary

HI

If your above set analysis is working. i would try putting it in a Variable. vCustomer

Then trying ONLY({<Customer={'$(vCustomer)'}>}Country).

Mark

View solution in original post

4 Replies
Anonymous
Not applicable

If your expression works then you should just be able to change the "Customer" field to "Country" field as the data is linked so you will get the same result but it will return the Country

Mark_Little
Luminary
Luminary

HI

If your above set analysis is working. i would try putting it in a Variable. vCustomer

Then trying ONLY({<Customer={'$(vCustomer)'}>}Country).

Mark

agigliotti

maybe this:

=Only( Aggr( if( sum({$< Year = {'$(vMaxYear)'}, OrderDate = {'<=$(vMaxDate)'} >} SalesFinal) =

Max( Aggr( sum({$< Year = {'$(vMaxYear)'}, OrderDate = {'<=$(vMaxDate)'} >} SalesFinal), Country ) ), Country, null() ), Country ) )

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
joaovieira
Partner - Contributor II
Partner - Contributor II
Author

Thank you, it works well and it will help with other things i wasn't able to do.