Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ARGB in the script

Hello,

I have an "agency" field and I try to set a specific color per branch. I would like to optimize my graphics and thus make this method through the script (and not having to specify each time in my expression, in background color more precisely, the formula to usa).

To know that my QlikView QVD project generates files (one file per table QVD).

Besides that, under Excel, I have an excel file named "Parameters" with two tabs, one calling itself "metadata" (I renamed the tables and fields) that looks like this:

TABLE.IN          TABLE.OUT          FIELD.IN           FIELD.OUT

................           ...............              ...............          .................

And the other tab naming "color" which is as follows:

NAME         A        R         G       B

Agency1     255     255     153     51

Agency2     255     0          153     0

Agency3     255     51         0        153

Agency4     255     255       255    153

I wrote this in the script but it does not work ..... :

In the script, in the COLOR tab:
color_map:
Mapping
LOAD NAME, argB (A, R, G, B) as nameColor
FROM [xxxxxxxxParameters.xlsx] (OOXML, embedded labels table is COLOR)
;


In the script, in the QVD tab:
ApplyMap ( 'COLOR' NAME) have nameColor






Can anyone help me solve my problem?


Regards,


Prees

2 Replies
Gysbert_Wassenaar

ApplyMap ( 'COLOR' NAME) have nameColor

This is not a correct syntax to use applymap

Applymap() needs at least two arguments:

  • the name of the mapping table, in your case color_map
  • an expression that returns the value that should be looked up in the mapping table.

You need something like Applymap('color_map', MyFieldNameHere) as NewFieldNameHere


talk is cheap, supply exceeds demand
HirisH_V7
Master
Master

Hi,

check this,

Color Logic – loading multiple Color schemes

HirisH
“Aspire to Inspire before we Expire!”