Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable



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
Honored Contributor II

Re: Exclusion

‌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

Re: Exclusion

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))


Re: Exclusion

Try this expression

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


If you select only one department always then use below expression

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

Hope this helps you.



Valued Contributor III

Re: Exclusion


Try this Expression


Honored Contributor II

Re: Exclusion

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.

Community Browser