Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
luizcdepaula
Creator III
Creator III

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.

LD

3 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

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.

Regards,

Jagan.

Anonymous
Not applicable

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]))))

luizcdepaula
Creator III
Creator III
Author

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.