Hello, I wanted to add functionality to allow user's to select between three pre-defined 18 color palettes. My solution was to create 3 sets of 18 variables, each holding an RGB value of the given color (e.g. vColorPalette1Color1=rgb(25,125,177), vColorPaletteColor2=rgb(92,146,70), vColorPalette2Color1=rgb(25,56,100), etc.). I also created another variable (vColorPalette) which would hold a value of 1, 2, or 3. This allows the user to switch their active color palette.
I then set each of the 18 colors on each chart's Colors tab to use the following calculated expressions:
My question is if there is a better way to optimize these calculations. 18 of these expressions are calculated whenever a chart is re-drawn. One thing that I can think of is to store these expressions inside 18 new variables, e.g.:
I guess I'm a little confused as to what you are saying. It sounds like you are assigning colors to field values? That isn't the problem I am facing, I already have a method for managing that. I want to be able to allow the end-user to select between different color palettes.
Essentially my question is how does QlikView evaluate variables. For instance, let's say that I want the first color in the palette to be rgb(25,125,177). If I have the color expression be =$(='vColorPalette' & $(vColorPalette) & 'Color1') then it will calculate every time. But if I store that expression in a variable (vColor1), does QlikView remember the value of that variable and avoid the calculation?