Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to toggle (multiple) field values with an action button?

Hi experts,

I am battling with an action button that allows me to switch between two field  values. (QlikView 11.0)

I have a TURNOVER table that contains two date fields: %SLDate and %WLDate. Linked are the tables Date_SL and Date_WL.

With a button, I would like to assign the selected values of Date_WL.Month to Date_SL.Month and vice versa.

TestGetFieldValues1.PNG  ---->TestGetFieldValues2.PNG

This works fine, as long as I select only one value (e.g. ‘Jan’).

As soon as I select more than one value (e.g. ‘Jan’ & ‘Feb’) and press the button, the selection for both fields is empty.

TestGetFieldValues3.PNG  ----> TestGetFieldValues4.PNG

I use a variable that toggles between 1 and -1.

Further on I use two 'Select in Field'

      for    Date_WL.Month  ( if($(vToggleDate)=1, GetFieldSelections(Date_SL.Month,',',15))  )

      and  Date_SL.Month (   if($(vToggleDate)=-1, GetFieldSelections(Date_WL.Month,',',15))  )

How can I make the function to accept multiple selections?

Thanks in advance for your help.

1 Solution

Accepted Solutions
pokassov
Specialist
Specialist

Hello!

for multiple selection you have to use this format (value1|value2).

Try something like this:

=if($(vToggleDate)=1, '('&GetFieldSelections(Date_SL.Month,'|',15)&')')

View solution in original post

3 Replies
pokassov
Specialist
Specialist

Hello!

for multiple selection you have to use this format (value1|value2).

Try something like this:

=if($(vToggleDate)=1, '('&GetFieldSelections(Date_SL.Month,'|',15)&')')

maxgro
MVP
MVP

=if($(vToggleDate)=1, '("' & concat(DISTINCT Date_SL.Month, '"|"') & '")', '')

Not applicable
Author

Thanks Sergey,

your solution works exactly as I need it.

Best regards,

Hermann