Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

Multiple selections same value

Hi experts,

I am having trouble in finding the right function to keep the selection in a chart. I have a chart displaying Fill Rate for years 2013, 2014, 2015, 2016, and the GOAL. The users want to see only the Goal and 2016 as default. But if they select 2013, 2014 and so on, the line for that year will appear in the chart. I am using the function below and I tried several different combinations, but nothing worked. When one year is selected, that year appears, but as soon as I select another year, it disappears.

The function I am using is :

If(not isnull(GetFieldSelections([Year])),if(Match(Year,'2013'),Sum({$<Year={'2013'}>}[Delivery quantity_LFIMG.LIPS]) /

Sum({$<Year={'2013'}>}[Cumulative Order Qty_KWMENG.VBAP])))

Find attached a picture of the chart of what I have now.

Any ideas?

Thank you in advance.


3 Replies

Re: Multiple selections same value


Try like this

If(GetSelectedCount(Year) = 0,

Sum({$<Year={$(=Max(Year))}>}[Delivery quantity_LFIMG.LIPS]) /

Sum({$<Year={$(=Max(Year))}>}[Cumulative Order Qty_KWMENG.VBAP]),

Sum([Delivery quantity_LFIMG.LIPS]) /

Sum([Cumulative Order Qty_KWMENG.VBAP])


Hope this helps you.



Esteemed Contributor

Re: Multiple selections same value

Your Syntax look okay, why you are using set analysis again if you have used in IF condition

may be like this?

If(not isnull(GetFieldSelections([Year])),

if(Match(Year,'2013'),(Sum([Delivery quantity_LFIMG.LIPS]) /Sum([Cumulative Order Qty_KWMENG.VBAP]))))

Contributor II

Re: Multiple selections same value

Both of these ideas are good ideas, but only work partially. The syntax from Jagan, it displays the max year selected. I need to be able to select 2013 and still show 2014 and/or 2015 in another line. This syntax gives me only max year.

The syntax from Balraj, is similar to what I have, and I can show 2013 when selected, but when I make another selection, for example 2013 and 2014, 2013 disappear.

I need to have different lines for each year, with capability of checking them in or out, as in a check box.