Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

i want expression to change based on filter selection

I'd like my default view to always calculate on this particular expression.

Count(distinct {$ <BINFlagToday={1}>} BIN)

however, I have quarter and FY filter panes.  if the user selects a value within the quarter filter pane, the expression needs to change to

Count(distinct {$

<BINFlagQuarter={1}>

}
BIN)

and for FY

Count(distinct {$

<BINFlagFY={1}>

}

and if all selections are clear, I'd like it to go back to the default expression.

how can I do this without having to make a duplicate page?

2 Replies
rubenmarin

Hi Maria, if this is in a chart you can use conditional expressions:

Create both expressions and for first expression you can set the conditional:

GetSelectedCount(QuarterField)+GetSelectedCount(YearField)=0

And for the second:

GetSelectedCount(QuarterField)+GetSelectedCount(YearField)

Silambarasan1306
Creator III
Creator III

Hi,

Just do like below mentioned.

Create a dimension. Thats your filter.

Example.

Load * Inline [

Filter

FY

Quarter

]

Create a variable,

=If (Filter='FY','Quarter Expression',

  If (Filter='FY','FY Expression','Today()'))

Call that variable in the Set Analysis.