Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis: Ignore or include selected dimension

Hi,

I am not able to find out how to ignore and include some of the dimensions using set analysis. For ex:

Emp    Team   Sales

e1        T1        1000

e3        T2         500

e2        T1         1500

Now selecting e1 should give sum of corresponding team i,e 1000 + 1500 = 2500.

I am using this expression in Text object:

sum({$< Team = {$(#vTeam)}>}Sales) but result is 0.

What is the error here?

Also, what are other ways to achieve this?

Thanks for your time!

regards,

Mayank

Message was edited by: mayank.rishu

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try sum({<Emp=p({<Emp=,Team=p(Team)>}Emp)>}Sales). See attached example.


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
Not applicable
Author

this should work

=

sum({$<[team]={'t1'}>} [sales]

Gysbert_Wassenaar

If you have a variable vTeam with value T1 then sum({$< Team = {'$(vTeam)'}>}Sales) will return 2500.

It's not possible to select only e1 and get the total for T1 back and not for T2. e1 is a member of both T1 and T2 so there's not enough information to determine which team total should be shown if you select only e1.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks miteamgib!

This will certainly work but I can't limit it to 't1'. Data can vary accordingly.

Not applicable
Author

Hey Gysbert,

yes I have variable but this is also showing up 0!

Not applicable
Author

Gysbert,

I agree on your explanation so lets invert the selection to e2. Selecting e2, I need total sum of T1.

Mayank

Gysbert_Wassenaar

Try sum({<Emp=p({<Emp=,Team=p(Team)>}Emp)>}Sales). See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

This looks correct! Exactly what I was looking for. Thank you!

MK_QSL
MVP
MVP

Can you explain ? Thanks in advance.

sum({<Emp=p({<Emp=,Team=p(Team)>}Emp)>}Sales)

Not applicable
Author

I had the same question

p = possible

e = exclude

See:

P() &amp; E() and where do you use them?