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: 
MariaN
Contributor II
Contributor II

Dynamic measure selection for a line chart

Hi!

I would like to make a dynamic measure selection for a line chart, but don't know where to begin. I have about 20 measures and I would like for the user to be able to select as many as they want and be able to compare them in a line chart.

Example: the user would want to see how waiting time affects customer satisfaction so the user could select the two measures and the line chart would show them. In addition, the user would want to also compare how employee happiness affects these two measures and adds that into the selections.

In this manner, the user should be able to choose any number of measures between 1-20 and they would show on a line chart.

Labels (1)
4 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @MariaN 

I would suggest you download and take a look at how I do this in my Instant Sense Application template:

https://community.qlik.com/t5/Qlik-Gallery/Quick-Intelligence-Instant-Sense-App/ba-p/1721815

This application loads dimensions and measures from a spreadsheet and then allows the user to pick dimensions and measures from list boxes to compare values.

I think the maximum number of measures I have on on object presently is six, but you can copy and paste the measures and change the numbers in the call to the variable. So the expression for the sixth measure is =$(=$(vExpNFmt(6))) , you can copy that to get up to 20, if you wish. You would also need to set the label and the show condition for the measure accordingly. That will make more sense when you see the app!

There is a blog post on how the app is created here:
https://www.quickintelligence.co.uk/instant-qlik-sense-application/

Hope you find it useful.

Cheers,
Steve

 

 

vinieme12
Champion III
Champion III

Create as list of all MEasure NAmes in your load script as below

example

Measures:

Load * inline [

MeasuresList

Sales

Revenue

Margin

Stock

];

 

In the Line Chart Add ALL the MEASURES with calculation condition

Sales  = Sum(Sales)

Show Column if =  index('$(=GetFieldSelections(MeasuresList,''))','Sales')

 

Margin  = Sum(Margin)

Show Column if =  index('$(=GetFieldSelections(MeasuresList,''))','Margin')

 

Stock= Sum(Stock)

Show Column if =  index('$(=GetFieldSelections(MeasuresList,''))','Stock')

 

Stock ,Margin, Sales should match the MeasuresList values

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MariaN
Contributor II
Contributor II
Author

Hey @vinieme12 !

Thank you for the response, but there is no option in the line chart measures to use the show condition.

MariaN
Contributor II
Contributor II
Author

Thank you @stevedark , I will look into this.