Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
A fixed primary dimension: Week.
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?
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.
Hello,
the expression is a good idea, do you know a Qlik Cloud Expression to says ("use color as usual") ?
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))