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

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with multiple selections

I have defined a set analysis as below in a Pivot Chart. It works fine when I have only one selection made for FIELD2 as I was using getfieldselections. FIELD2 is actually one of the dimensions. When I make multiple selections the output of getfieldselections(FIELD2) will be several values separated by comma like A,B,C


=Sum({$<FIELD1={'$(=getfieldselections(FIELD2))' }>} FIELD3)


It there a way to use set analysis to wildmatch the selections made for FIELD2 and get the sum?

15 Replies
sunny_talwar

I am not sure I gather completely. If you are making a selection in Field2, then you will only see what you have in Field2 (unless you have a restricting set analysis)

This is what you want?

Capture.PNG

Capture.PNG

Not applicable
Author

You are missing the expressions. Which is like count of appearances. 

Not applicable
Author

Do you think this can be achieved using SUM(IF(...)) ?

swuehl
MVP
MVP

Yes...

=count(If(FIELD2=FIELD1,FIELD1))

Not applicable
Author

This could be done in the this way but I have one more expression which involves a filter in the set analysis.

I think I will have to move the 3rd expression to different table.

=Sum({$<FIELD1={'$(=getfieldselections(FIELD2))' },FIELD5={0}>} FIELD6)  --> Third expresion


Thanks for your help.

Not applicable
Author

Please try this:

=Sum({$<  $(='FIELD1 = {' & getfieldselections(FIELD2)  & '}') >} FIELD3)


If FIELD2 values contain spaces then you need to concatenate them using single quotes.


=Sum({$<  $(='FIELD1 = {' & Chr(39) & getfieldselections(FIELD2, Chr(39) & ',' & Chr(39)) & Chr(39)  & '}') >} FIELD3)


Best regards,

Daniel