Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
peterstalberg
Contributor III
Contributor III

Set analysis issue

Hi experts,

I'm stuck in a set analysis expression not giving me the expected result. Check out the table below, country Sweden and customer 'BB' & 'CC' are selected. Measures in column 3-5 gives me the expected result. For column 6 I want to show all sum(Sales) except for customers NOT selected under the selected country ('AA' & 'DD'). Any help on how to phrase this set expression would be highly appreciated. RGDS//Peter

peterstalberg_0-1676361835786.png

 

Labels (2)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Well, if you are looking for something like below:

tresesco_1-1676438546225.png

 

Sum({1<Customer=e({<Customer,Country=$::Country>}Customer)>+<Customer=p(Customer)>}Sales)

Possibly the expression can be simplified, you can give a try.

View solution in original post

4 Replies
tresesco
MVP
MVP

Your first three measures look to be equivalent to simple  -   Sum(Sales). While for the last one, you could try like:

Sum({1<Customer=e(Customer)>}Sales)

peterstalberg
Contributor III
Contributor III
Author

Hi Tresesco,

Thank you very much for your response. Unfortunately, this expression excludes customer 'BB' & 'CC'. AS described previously, I want to exclude 'AA' & 'DD' which has not be selected under Sweden an then include everything else. I have attached the qvf for clarity. Appreciate any further input. Regards//Peter

Note: Sweden, 'BB' & 'CC' are selected in the table.

 

peterstalberg_0-1676391911536.png

 

tresesco
MVP
MVP

Well, if you are looking for something like below:

tresesco_1-1676438546225.png

 

Sum({1<Customer=e({<Customer,Country=$::Country>}Customer)>+<Customer=p(Customer)>}Sales)

Possibly the expression can be simplified, you can give a try.

peterstalberg
Contributor III
Contributor III
Author

Hi Tresesco,

Spot on - thank you very much😀 Not sure if I can simplify your suggestion but I'll try to change the other measures using  e & p switches rather than the "getfieldselections" approach. RGDS//Peter