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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
herard_bertrand
Partner - Creator II
Partner - Creator II

How to preserve 'Color by Dimension' when a dimension is conditionally hidden?

Hello everyone,

I'm looking for a solution to a conditional formatting issue on a chart.

Context: My chart (a standard Line chart) is built with two dimensions:

  1. A fixed primary dimension: Week.

  2. A second, dynamic dimension controlled by the user, which can be Product, Brand, or even Week.

The purpose of this second dimension is to display a reference value. For example to compare a product's prices to a reference product or to compare the prices of week N to a reference week.

The Problem: When the user selects Week as the second dimension, the chart tries to display the same dimension twice, which causes an error. To work around this, I've added a display condition on one of the dimensions to hide it in this specific case.

The Side Effect: This solution works for the display, but it has a major drawback: the color formatting, which is configured by dimension, disappears as soon as the condition is met. The chart displays correctly, but without the custom colors.

Does anyone have an idea on how to get around this issue and maintain the color formatting even when the reference dimension is Week?

Labels (3)
3 Replies
rubenmarin

Hi, you can simulate the fixed color with a color expressionlike: Color(FieldIndex('FieldName',FieldName))

But that will need to be adapted to your dynamic dimension.

A workaround could be also changing the dynamic dimension to use somethinglike 'Total' (a fixed string) when the Week dimension is selected, so it only has one value and could be seen as if there wasn't a second dimension.

herard_bertrand
Partner - Creator II
Partner - Creator II
Author

Hello, 

the expression is a good idea, do you know a Qlik Cloud Expression to says ("use color as usual") ?

rubenmarin

Hi, I'm not sure what means "use color as usual", if it's a fixed color, use RGB(Colorcode), for default by dimension it might be based on the chart type and configuration, but maybe Color(Rowno(TOTAL))