Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a scatter plot and I want the user to be able to pick 2 points from the scatter plot, and then have 2 pie charts reflect the market share of each point that was selected (so they can compare market share at point 1 vs market share at point 2).
I have a variable that grabs the point that was selected from the scatter plot (it's called PICK2).
When I use the below expression, and hard code the PLAN that was selected, it works. When I use the variable, it does not.
Does anyone know how to convert this to use my variable instead of hardcoding it?
This works with hardcoding:
avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2, PlanName={'Acme Plan'} >}MarketSharePercent)
This does not work with my variable:
avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2, PlanName=$(Pick2) >}MarketSharePercent)
Thank you in advance!
MNike
May be try this
Avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2, PlanName = {'$(Pick2)'} >} MarketSharePercent)
Ok that may be my problem. Right now Pick2 is: Acme Plan.
How can I get my variable to format as {'Acme Plan'}, or how can I change my set expression to handle that?
Thank you!
Mike
I tried this, but unfortunately my pie chart was still blank.
Any other thoughts?
Mike
vPick2 = '{'& Concat(DISTINCT Chr(39) & Pick2 & Chr(39), ', ') & '}';
Ok I think we're getting closer! I formatted my variable the way you described. Now its like this:
Pick2 = {'Acme'}
This continues to work when hardcoded, but still doesn't work with the Pick2 variable.
avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2, PlanName={'Acme'} >}MarketSharePercent)
I've tried every combination of PlanName=Pick2, PlanName=$(Pick2), etc. and my pie chart is still blank.
Any other ideas what I'm doing wrong?
Mike
...and a little more info that may help:
My Pick2 variable now looks like this:
Pick2='{'& Concat(DISTINCT Chr(39) & SubField(GetFieldSelections(PlanName),',',2) & Chr(39), ', ') & '}';
Any help would be greatly appreciated!
Mike
Do I understand correctly that the SET modifier
PlanName=$(Pick2)
should set PlanName to all selected PlanName?
This is default behavior in Qlik Sense. Can't you just use the expression without the PlanName modifier?
avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2>}MarketSharePercent)
If this is what it is, why don't you just use this
Avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2, PlanName = P(PlanName)>}MarketSharePercent)
or this
Avg({<myFilter1=$::myFilter1, myFilter2=$::myFilter2, PlanName = $::PlanName>}MarketSharePercent)