Discussion board where members can get started with QlikView.
I have a field as follows:
and I have 5 variables as:
vA, vB, vC, vD, vE
I want to set these variables to true/false based on the selection of values in field. For example, if A and C are selected in field 'Filter', the variables vA and vC should be set to true and others should remain false.
Please suggest how it can be achieved.
vA: =(max(match(Filter,'A')) and GetSelectedCount(Filter))
vB: =(max(match(Filter,'B')) and GetSelectedCount(Filter))
View solution in original post
Hi Nishat, you can create the 5 variables and add a trigger for OnSelect and/or OnChange for the Filter field.
this trigger has 5 'set variable' actions, one for each variable, lokking if Filter contains the value and set 1 or 0, accordly
Value: =If(Index(Concat(Filter), 'A'), 1, 0) <-- Stores 1 if 'A' is included in the possible values for filter.
Take care if some values of filter are substrings of others, if this happens you'll need to add something more to identify each value
vA= substringcount( getfieldselectionst(Filter),'A')
the other variables according
Similarly is there anyway to set a variable vSingleTypeSelected to 1 when a distinct value in the Type field is clicked?