Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

mariasdu
Contributor

Change colorvalue in predefined variable using the FieldIndex statement

Hi everyone

I have a problem getting an expression to be valid.

I have defined some color-variables which I can use by typing

   $(vGrafFarve4)

This variable contains the color code: ARGB(255,141,170,203)

But if I want the color value to be dynamic, so instead of typing color 4 in the statement above, I want to call a numeric value, which I get from this statement:

   =FieldIndex('Fakultet', 'Humaniora') --> 4

How do I do that`?

I tried something like:

   =$(vGrafFarve&FieldIndex('Fakultet', 'Humaniora'))

and

  ='$(vGrafFarve'&FieldIndex('Fakultet', 'Humaniora')'&')'

But none of it works.

Kind Regards

Maria

5 Replies
lironbaram
Honored Contributor II

Re: Change colorvalue in predefined variable using the FieldIndex statement

you can try

something like

$(='vGrafFarve'&FieldIndex('Fakultet', 'Humaniora'))

mariasdu
Contributor

Re: Change colorvalue in predefined variable using the FieldIndex statement

Thanks for the answer!

This gives me almost what I want.

It gives me an argb color code, but not the right one.

I get the color code argb(600,128,64,0), but I need it to be argb(255,128,64,0) which the predefined variable $(vGrafFarve4) contains.

I double checked that the statement =FieldIndex('Fakultet','Humaniora') gives me the number 4.

Any ideas why I don't get the right color code?

lironbaram
Honored Contributor II

Re: Change colorvalue in predefined variable using the FieldIndex statement

hi

try to put this expression in text box

='vGrafFarve'&FieldIndex('Fakultet', 'Humaniora')

what is the result

mariasdu
Contributor

Re: Change colorvalue in predefined variable using the FieldIndex statement

This gives me the text vGrafFarve4

lironbaram
Honored Contributor II

Re: Change colorvalue in predefined variable using the FieldIndex statement

hi

i have no idea , i tried it in my side and it seems to work well

can you share a sample app with the issue

Community Browser