Qlik Community

QlikView Documents

Documents for QlikView related information.

Create Colour Variables from an Excel Workbook

Luminary
Luminary

Create Colour Variables from an Excel Workbook

Hi,

Here's a basic script which loads an excel workbook sheet containing colours into QlikView.

Once loaded the script loops through the table and creates variables which can be used in your design template.

I will be uploading a video tutorial to my blog shortly.

Richard

QlikCentral.Com

Attachments
Comments
thornofcrowns
Valued Contributor II

Hi Richard,

we use a similar script:

Colour_Table:
LOAD VariableName,
     RGBValue,
     ColourName
FROM
[\\..\..\Colour_Scheme.xlsx]
(ooxml, embedded labels, table is Colours);

NumRows=NoOfRows('Colour_Table');

FOR i=1 to $(NumRows)
   let vVariableName = FieldValue('VariableName',$(i));    
   let vVariableRGB = FieldValue('RGBValue',$(i));    
   let $(vVariableName) = '=$(vVariableRGB)';   
NEXT

Comment Tables Colour_Table With 'This is the new way';

Luminary
Luminary

Great minds James!!


thornofcrowns
Valued Contributor II

dlanglois
New Contributor

Hi Richard,

I have done something similar and I am using a function for each color in a given chart's palette. I find that when I reference these colors using the color(n) function, the "fixed" option for the color is used instead of the calculated color. Have you experienced this as well? I am struggling to find a solution.

Thanks,

David

0 Likes
Luminary
Luminary

Hi David,

I'm not sure if I fully understand your issue. I have instances where using the $(=RGB(*,*,*))  a variable doesn't work. Usually within conditional statements and I have to use the individual colour values

RGB($(Value),$(Value),$(Value)).

Could you provide a little more information and perhaps a link to an example?

Thanks

Richard

Luminary
Luminary
0 Likes
datanibbler
Esteemed Contributor

Hi,

we have sth like that as well, only we don't use an Excel file, but just a qvd file with the SET commands. It's very helpful to make it all appear somewhat uniform and not have it blaring in all kinds of colours.

Version history
Revision #:
1 of 1
Last update:
‎2014-07-07 05:18 PM
Updated by: