Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
chrweber
Creator
Creator

Color Formulas wont evaluate Color String

Hi, I am experimenting with color formulas

I have a table with color labels and strings that can be evaluated by qlikview

Load*

from inline

[

     ColorName, Color

     lightred, =lightred()

];

Now I want to simulate an evaluation in a chart color formula field

=only({$<ColorName={'lightred'}>} Color)

where Color returns '=lightred()'

Outputting this as a string returns the proper result, one which if typed manually in  the color formula field would yield a light red color.

Am I missing something? Are Formulas doing something different?

Do I have to modify the string somehow?

Best Regards

3 Replies
jaumecf23
Creator III
Creator III

This formula is working for me:

=$(only({$<ColorName={'lightred'}>} Color))

marcus_sommer

There is no direct evaluate() within the UI available - an expression from a field or a variable will always be treated as a string and only if you used a $-sign expansion like here suggested from Jaume it will be evaluated. But a $-sign expansion creates logically a new (adhoc) variable which will within an object-context be always globally and not evaluated on a row-level.

There are now several similar questions (Re: Inputbox with predifined Values using RGB, comma problem) to the same task and I have the feeling they are running in circles so that I suggest you provide a small example which displays how and where you want to assign the colors.

- Marcus

chrweber
Creator
Creator
Author

I have taken the time and tried to visualize my problem over the course of which I found the solution:

So thank you for your help, I have added the file:

The Solution is the following line:

=$(=only({$<CustomColor={$(vColor3)}>} ColorVariableConcat))

So I had to put in an additional '='

Thank you for your help.

The other questions were problems on their own, so I thought I put them apart