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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exclusion

Hi,

How can I make a measure conditioned to a selected option in a filter pane?

For instance, my filter option under Department (this is the name of the field) is "CORP", I want the measure to adjust to this filter wheter CORP is selected or not.

It could be something like: if(Department = 'CORP', SUM(Amount1), SUM(Amount2))

I would appreciate your help.

5 Replies
ogster1974
Partner - Master II
Partner - Master II

‌for this type of solution I use an extension to set a variable and apply to the measure, dimension etc.. See this link for a example of how I've don'te it in the past.

Makes Sense to go round in circles

Not applicable
Author

What if you used the concat() function to establish the possible values.  It's a stretch but doesn't require building an extension object.

=if(concat(DISTINCT [Department Type], ', ') like '*CORP*', SUM(Amount1), SUM(Amount2))

jagan
Partner - Champion III
Partner - Champion III

Try this expression

If(SubStringCount('|' & GetFieldSelections(Department , '|', 10000) & '|', '|CORP|'), SUM(Amount1), SUM(Amount2))

OR

If you select only one department always then use below expression

if(Only(Department) = 'CORP', SUM(Amount1), SUM(Amount2))


Hope this helps you.


Regards,

Jagan.

sasikanth
Master
Master

HI,

Try this Expression

Sum(if(Department='CORP',Amount1,Amount2))

reddy-s
Master II
Master II

Hi Cesar,

Your expression will just work fine "if(Department = 'CORP', SUM(Amount1), SUM(Amount2))" if you have a second dimmension added to your visual. This will even work when you have a filter set. So adding a second dimension which has the value CORP will do.