Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Venamma23
Contributor III
Contributor III

Variables with colors in Qlik Sense

Hello Everyone,

I have come across a situation where I need to manually assign color to my measures  by creating Master items.

I have around 30+ variable calculations created in the script and each one requires different color. for time being I m creating a master measure for all the variables and assigning a color over there.

Is there any way to simplify this ? where we can specify all the variable names and assign some colors in the script or extension itself before we use them to create visualization.? So that wherever we use that specific variable same color should be carried out to the entire dashboard.

Can Someone help me please?

Regards,

Venamma

Labels (2)
4 Replies
ArnadoSandoval
Specialist II
Specialist II

Hi @Venamma23 

There was topic yesterday with this solution posted with an example, Would it help you? example

Hope this helps, 

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
Venamma23
Contributor III
Contributor III
Author

Hi,

Master measures can be created within the sheet. But I'm looking for something which can be defined at script level or may be if we have any extensions for the same.

Regards,

Venamma

ArnadoSandoval
Specialist II
Specialist II

@Venamma23 

Yes, you can assign colors to variables in the script like this:

Let vRed   = Red();
Let vGreen = Green();
Let vBlue  = Blue();
Let vRedRGB   = ARGB(255, 255, 26, 26);
Let vGreenRGB = Argb(255, 0, 102, 0);
Let vBlueRGB  = Argb(255, 26, 26, 255);

Let vRedRGBLight   = ARGB(128, 255, 26, 26);
Let vGreenRGBLight = Argb(128, 0, 102, 0);
Let vBlueRGBLight  = Argb(128, 26, 26, 255);

and consume them at the UI with this results:

11.VariableColours-01.jpg

Using the facilities to color dimensions or measures

11.VariableColours-02.jpg

Regards

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
Gui_Approbato
Partner - Creator III
Partner - Creator III

You mentioned variables but this example might help:

Sometimes I need to assign color to my dimensions, so I just create a table with a column for color. Example:

DimensionColorABC
Tomatorgb(207, 35, 35)
Orangergb(207, 107, 35)
Avocadorgb(49, 207, 35)
Bananargb(207, 207, 41)

 

Then I link the dimension with my main table and use the ColorABC column as a "pure" expression in the chart.

Tip: type "rgb 0 0 0" in google to easily find the rgb codes