Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a list box or multi-box for expressions (instead of dimension)

Is there a way to set up something similar to a list box or multi-box that lets the user choose which expression(s) they want to see in a straight table?  A user asked if I was able to add in some options to a table that I created for them, so that they can choose if they want to show total sales, or have the option to show the average sales price, or mode sales price.  But the catch is they want to have the option to show it one time and not another, depending on what they're using the data for.

I know how to create the various totals on the expressions page (and their question isn't limited to just different types of sums but also entirely different expressions), but I haven't figured out how to set that up similar to how a list box is designed.

Any ideas?

1 Solution

Accepted Solutions
simenkg
Specialist
Specialist

The way you do this is by creating a Data Island.

Expressions:
load * inline [

%ExpressionLabel, %ExpressionID

Total Sales, 01

Total Budget, 02

];

Create a listbox with %ExpressionLabel

Then in the expression tab of your chart you enable "Conditional" and use the expression (for Total Sales):
substringcount(concat(%ExpressionID,'|'),'01')=1

To disable all expressions if no value is selected, go to the general tab and under Calculation Condition use the expression:

Getselectedcount(%ExpressionLabel)>0

View solution in original post

4 Replies
simenkg
Specialist
Specialist

The way you do this is by creating a Data Island.

Expressions:
load * inline [

%ExpressionLabel, %ExpressionID

Total Sales, 01

Total Budget, 02

];

Create a listbox with %ExpressionLabel

Then in the expression tab of your chart you enable "Conditional" and use the expression (for Total Sales):
substringcount(concat(%ExpressionID,'|'),'01')=1

To disable all expressions if no value is selected, go to the general tab and under Calculation Condition use the expression:

Getselectedcount(%ExpressionLabel)>0

MarcoWedel

Maybe using grouped expressions could be a solution. (Expression tab / group)

another possibility could be an island table with selectable expression names and a pick function to switch the expressions in the chart.

hope this helps

regards

Marco

sujeetsingh
Master III
Master III

Study this sample it is just handled with nested if

Not applicable
Author

Thank you!  That was quick and easy!