Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
Jennell_McIntire
Employee
Employee

Conditional show or hide is available in line and bar charts giving the user the ability to toggle dimensions or measures on or off in a single chart. This allows developers to customize line and bar charts and save space by using one chart to show various metrics and dimensions. Let’s look at a simple way of using this feature to show or hide lines in a line chart. In the Overall Equipment Efficiency demo found on the Demo Site, there is a line chart accompanied by buttons that are used to toggle the lines on and off in the line chart.

demo.pngThis is done by using variables. When each button is clicked, the respective variable is toggled from 0 to 1 or 1 to 0 depending on its current value. See the value expression in the image below.

variable.png

 

 

 

 

 

 

 

 

 

 

 

In the measure expression in the line chart, this variable is checked to determine if the expression should be evaluated and displayed or if the measure should be set to null.

if.png

 

This is a perfectly good way to toggle the lines, but with the ability to use conditional show and hide in line and bar charts, this process can be simplified. First, in the measure expression, we no longer need to use an if statement which can help reduce calculation time. We can simply use our normal expression and the “Show measure if” setting, with the respective variable, to evaluate if a line should be shown in the visualization or not.

show measure if.png

 

 

 

The “Show measure if” and “Show dimension if” settings evaluate the expression and will show the line if the expression evaluates to true. In my example, vShowOEE will be either 1 or 0. If it is 1, the line will be displayed. If it is 0, then it will not be displayed. We can continue to use the buttons to toggle the respective variable (from 1 to 0 and vice versa) for each line.

My example is basic, but more complex expressions can be used as well. For example, you may want to show/hide lines based on a selection or a calculated value or you may want to use some business logic to determine which dimension or measure should be displayed. The expression can be as simple or complex as needed, as long as it returns a true or false value. Keep in mind, that this show setting is optional and can be left blank. When no expression is entered, the line (or bar) is displayed.

There are a few limitations of this new feature to be aware of: 1) Custom tooltips are disabled when using a conditional dimension, 2) Time series forecasting is not available when using conditional dimensions or measures. While the “Show measure if” and the “Show dimension if” can both be used in the same chart, it is recommended that you use only one at a time. Check out Qlik Help to learn more and test this new feature out in your next line or bar chart.

Thanks,

Jennell

5 Comments
JarnoH
Partner - Contributor
Partner - Contributor

It would be great if this feature were available also for combo chart! Wondering if it's coming up somewhere in the future..😊

1,664 Views
infrateam
Partner - Contributor
Partner - Contributor

I have checked both BAR and Line chart, But I dont find this ability. 

The challenge is, When we are trying to put a Conditional Dimension using IF statement.. When user selects on the chart the selections shows the calculation and not the actual selection.. I think this is a bug in Qlik Sense. 

 

In order to eliminate that, I was looking for a workaround and came to this post however after reading and checking back in the Qlik Sense Aug 2023 release I don't see this option IN THE LINE CHART wherein I can dynamically change the Axis based on user selection ..like from Weekly, To Monthly, Quarterly etc.. Please advise 

967 Views
Jennell_McIntire
Employee
Employee

@infrateam Hi, I assume you are using the client managed version of Qlik Sense.  If that is the case, you will find this functionality in the November 2023 version of Qlik Sense.

 

900 Views
soysauce
Partner - Contributor II
Partner - Contributor II

@Jennell_McIntire 

 

Hello Jennell, First of all Thanks for the amazing post!

I am wondering if 'Show measure if" function is available for May 2023?

499 Views
Jennell_McIntire
Employee
Employee

@soysauce This became available in the August 2023 client managed release.

0 Likes
386 Views