Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Jorich919
Contributor III
Contributor III

Combine values in a filter pane

I have a field called Billing_Type with values Credit Card, Cash, Money Order and COD.  I need to create a filter pane that does 2 things:

1) Omits COD as a choice, which I was able to do with this IF statement:
if(Billing_Type='COD', null(), Billing_Type)

2) Combine Cash and Money Order into one option called All Cash and when a user clicks on All Cash the KPI's and visualizations combine those 2 values.  Another way to think of it is, instead of someone choosing Cash and then also choosing Money Order to see that combined filter, I want the union to be on one choice called All Cash.

When correctly done, the filter pane should only show Credit Card and All Cash as the only 2 options.

How can I do that in my Filter Pane along with my line of code to omit the COD option?

Thank you!!

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

I dont know where you are performing the if statement. i would do this on load script and create a new column which you can use for selections

e.g.

 

if(Billing_Type='COD', null(), if(Billing_Type='Cash' or Billing_Type='Money Order','All Cash',Billing_Type)) as Billing_Type_New

Alternatively you could use a map and use applymap to set the values. Makes the code cleaner

https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/MappingFunctio...

View solution in original post

5 Replies
jmartineze
Partner - Creator
Partner - Creator

Hello Jorinch,

you can use set analysis in your expresions and  maybe declare one variable to control kpi expresion like 

if(vVariable=1,expresions1,expresion2)

Also you need a botton to change the variable value.

 

J.

dplr-rn
Partner - Master III
Partner - Master III

I dont know where you are performing the if statement. i would do this on load script and create a new column which you can use for selections

e.g.

 

if(Billing_Type='COD', null(), if(Billing_Type='Cash' or Billing_Type='Money Order','All Cash',Billing_Type)) as Billing_Type_New

Alternatively you could use a map and use applymap to set the values. Makes the code cleaner

https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/MappingFunctio...

Jorich919
Contributor III
Contributor III
Author

I tried variable input, but I went with the extra column creation in the load script. Works well.

Thanks to both of you!!

Shubham_Deshmukh
Specialist
Specialist

Hi,

I have condition in FILTER PANE using variable which has been created for VARIABLE INPUT ext. 

I have filter like this ,

= if((vSelectionOptions)='ABC',unit1,
if((vSelectionOptions)='PQR',unit2,
if((vSelectionOptions)='XYZ',unit3)))

unit1, unit2,unit3 are created in scripts.

But this is not wokring....pls help;

Jorich919
Contributor III
Contributor III
Author

Shubham....I'm still somewhat of a newbie to Qlik, so I can't explain the details of why it might work, but you might need to use "dollar sign expansion" with the variable. Try something like this for each if statement variable....

if( $ ( vSelectionOptions)= ........

Good luck.