Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select another color scheme when change dimensions in Pie chart

Gents,

I've a pie chart with a cyclic group, in this group 3 dimensions are available.

Per dimension I've a different color scheme for each pie.

I connected the RBG values of the dimensions in my datamodel.

The change of scheme I do in the following formula placed in + Background color of the expression!

Dimensions is the cyclic group and DIM1 to 3 are the underlying dimensions

=if(GetObjectField('Dimensions') = 'DIM1', rgb(R1,B1,G1),
   if(GetObjectField('Dimensions') = 'DIM2', rgb(R2,B2,G2),
     if(GetObjectField('Dimensions') = 'DIM3', rgb(R3,B3,G3))))

I get a lot of black pies etc.. not really what i want... I know for sure my Tables are filled with the correct values for RBG

For 1 dimension without cyclic group everything works fine.

So I can clone the chart, alter the RBG's and put them in a container... 3 times... 1 for each dimension

I think though a smoother solution must be possible....

Someone got an idea?

Thx

Felix

1 Solution

Accepted Solutions
Not applicable
Author

Hi DV,

thx for your answer!!

In the end next statement worked out best, although the syntax checker produced a red underline!!

=if(GetCurrentField(Dimensions) = 'Dim1', rgb(R1,B1,G1),
   if(GetCurrentField(Dimensions) = 'Dim2', rgb(R2,B2,G2),
     if(GetCurrentField(Dimensions) = 'Dim3', rgb(R3,B3,G3))))

Cheers

Felix

View solution in original post

2 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Hi Felix,

Are you using the Group Name within Double Quotes... something like this ("CyclicDimensionGroup") in the IF conditional statement? Also, another option is to Load Colors along with your Dimensions. I had loaded colors in my Load Script in the past and it works fine.

It will be best if you share the sample QV document. If you have sensitive data then please scramble the data.

Good luck!

Cheers - DV

Not applicable
Author

Hi DV,

thx for your answer!!

In the end next statement worked out best, although the syntax checker produced a red underline!!

=if(GetCurrentField(Dimensions) = 'Dim1', rgb(R1,B1,G1),
   if(GetCurrentField(Dimensions) = 'Dim2', rgb(R2,B2,G2),
     if(GetCurrentField(Dimensions) = 'Dim3', rgb(R3,B3,G3))))

Cheers

Felix