Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Jorich919
New Contributor II

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

Re: Combine values in a filter pane

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

3 Replies
Partner
Partner

Re: Combine values in a filter pane

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.

Partner
Partner

Re: Combine values in a filter pane

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

Jorich919
New Contributor II

Re: Combine values in a filter pane

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

Thanks to both of you!!