Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
glebret
Partner - Contributor II
Partner - Contributor II

Colors with Cyclic dimension

Hello,

I have an issue with the new cyclic dimension feature in Qlik Sense.

I created master dimensions and assigned colors to the different values of these master dimensions.

I then created a cyclic dimension and would like to assign some of my master dimensions in the cyclic dimension in order to use thee assigned colors in my chart.

Apparently, since I cannot use my master dimension in a cyclic dimension, I cannot reuse these colors.

Furthermore, it looks like I cannot assign colors at all to the different dimension values of a cyclic dimension.

Does anyone have a solution?

Thanks.

Best regards.

 

Gerald

Labels (3)
1 Solution

Accepted Solutions
Kushal_Chawda

@glebret  You can manage and define RBG colors is script and use it in color by expression in charts. See the example below if you want the different colour for Year & Name dimension. Here Year & Name will be linked to the actual data table

Qualify *;
Unqualify Year,Name;

year_clour:
LOAD * Inline [
Year, R,G,B
2021,100,90,0
2022,200,112,30
2023,0,30,120
2024,120,0,10];

name_clour:
LOAD * Inline [
Name, R,G,B
a,90,90,0
b,80,200,30
];

Unqualify *;

data_table:

LOAD Year, Name, Value.....

FROM table;

In chart color properties, set by expression to put below expressions

=pick(match(GetObjectDimension(0),'Year','Name'),
rgb([year_clour.R],[year_clour.G],[year_clour.B]),
rgb([name_clour.R],[name_clour.G],[name_clour.B]))

View solution in original post

4 Replies
MatheusC
Specialist II
Specialist II

You can use the function.

GroupDimensionLabel('Cyclic') or GroupDimensionIndex('Cyclic')

******************************************************************

If(GroupDimensionIndex('Cyclic')=1,blue(),red())

If(GroupDimensionLabel('Cyclic')=’Year’,blue(),red())



- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
glebret
Partner - Contributor II
Partner - Contributor II
Author

Hello Mateus,

I've thought about it but don't think it can work.

Indeed, let's pretend that my cyclic dimension contains 5 dimensions and that each dimension contains 5 distinct values. The idea was to create one master dimension for each dimension and define the color for each value I would have wanted to be able to set each master dimension as a dimension of the cyclic dimension in order to get the color affected to each value. UNfortunately, that is not possible.

Then, do you mean that my only possibility is to write a formula such as:

If(GroupDimensionIndex('Cyclic')='Year' and Year = '2024',blue(),

If(GroupDimensionIndex('Cyclic')='Year' and Year = '2023',red()...

))

 

I guess this could be done but isn't there a more efficient and dynamic way?

 

Kushal_Chawda

@glebret  You can manage and define RBG colors is script and use it in color by expression in charts. See the example below if you want the different colour for Year & Name dimension. Here Year & Name will be linked to the actual data table

Qualify *;
Unqualify Year,Name;

year_clour:
LOAD * Inline [
Year, R,G,B
2021,100,90,0
2022,200,112,30
2023,0,30,120
2024,120,0,10];

name_clour:
LOAD * Inline [
Name, R,G,B
a,90,90,0
b,80,200,30
];

Unqualify *;

data_table:

LOAD Year, Name, Value.....

FROM table;

In chart color properties, set by expression to put below expressions

=pick(match(GetObjectDimension(0),'Year','Name'),
rgb([year_clour.R],[year_clour.G],[year_clour.B]),
rgb([name_clour.R],[name_clour.G],[name_clour.B]))

glebret
Partner - Contributor II
Partner - Contributor II
Author

Thanks @Kushal_Chawda, it works like a charm. I must create an inline table but the solution is very efficient.