Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

select multiple Measures in barchart

hi, qlik community,

my requirement is to select multiple measures in the bar chart with the help of filter pane.

currently iam able to do this functionality by using below extension

https://github.com/barryharmsen/bitmetric-variable-toggle

but the main problem is I am able to select only one measure at a time with that button extension like below

image: multiple measures 1.png

multiple measures 1.png


finally what I want is I should able to select multiple measures in the bar chart with the help of filter pane something like below

multiple measures 2.png

attached sample   application please check and respond

timeline.qvf

its weekend time I have to complete this issue otherwise I have to stay in office even weekend also

stevedarkstalwar1‌ @mto paulodantas‌  omarbensalem




1 Solution

Accepted Solutions
OmarBenSalem

My bad !

alter u measures as follow:

if(SubStringCount ( Concat(MeasureID), 1 )<>0, Sum(cost))

if(SubStringCount ( Concat(MeasureID), 2 )<>0, Sum(weight))

if(SubStringCount ( Concat(MeasureID), 3 )<>0, Sum(weight)+sum(cost))

result:

Capture.PNG

Capture.PNG

Capture.PNG

Capture.PNG

View solution in original post

6 Replies
OmarBenSalem

Always use inline table for such a thing;

load * inline [

MeasureID,Measure

1,cost

2,weight

3,total

];

add this new field as a filter panel;

in ur expressions now, change them as follow:

measure1: cost

if(MeasureID=1, YourActualExpressionForSumCost)

measure2: weight

if(MeasureID=1, YourActualExpressionForSumWeight)

measure1: total

if(MeasureID=1, YourActualExpressionForTotal)

Now, depends on what u select; u'll have the measures u want to show..shown ! It's magic isn't it?

One more thing, u can add yet another coniditon in ur expression to show all 3 measure if u do not select any;

exp:

instead of if(MeasureID=1, YourActualExpressionForSumCost)

if(MeasureID=1 or count(distinct MeasureID)=3 , YourActualExpressionForSumCost)

Have a nice weekend

Anonymous
Not applicable
Author

thank you omarbensalem‌ for your suggestion, its working for only one selection not for multiple

example 1: if I select cost in filter pane its showing cost related bar in bar chart this is good
example 2: if I select cost and weight in filter pane nothing is showing in a bar chart.

multiple measures 3.png

required result: if I select cost and weight in the filter I am able to see the cost and weight bars in the chart.

Note: updated sample  app as you suggested please check

OmarBenSalem

My bad !

alter u measures as follow:

if(SubStringCount ( Concat(MeasureID), 1 )<>0, Sum(cost))

if(SubStringCount ( Concat(MeasureID), 2 )<>0, Sum(weight))

if(SubStringCount ( Concat(MeasureID), 3 )<>0, Sum(weight)+sum(cost))

result:

Capture.PNG

Capture.PNG

Capture.PNG

Capture.PNG

Anonymous
Not applicable
Author

yo, man omarbensalem‌ it's working!!!!!!, thank you so much my hugs to you from india.

deborahs
Contributor III
Contributor III

Thank you sir, this solution helped me out too!

gmf
Employee
Employee

load * inline [

MeasureID,Measure

1,cost

2,weight

3,total

];

add this new field as a filter panel;

_____________________

I need the above solution for my app. How do I create this field and add to filter pane. Is it created in the Load Editor? Could someone please provide more details