Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
NEW webinar Dec. 7th: 2023 Outlook, A Pivotal Year for Data Integration SIGN ME UP!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

color by expression - QlikSense

Hi all,

i am struggeling with a simple line chart. It shows revenue over month - so "Month" would be one dimension. It has two expressions. The one calculates revenue for the current year. The other calculates revenue for the previous year. All no problem.

What i want - and until now couldnt get to: I want the line representing the current year to have a specific color (lets say, red) and the line representing the previous year to have another specific color (lets say, gray).

Can anyone help and explain how this can be done in SENSE ?

Thanks!

K

45 Replies
reanfadyl
Partner - Creator
Partner - Creator

Nice work Steve! I tried this out and it worked fine. Pity picking a colour for a measure is so hard though.

Not applicable
Author

Hi Steve,

Is this also possible for a combo chart? Because I can not create a second dimension in a combo chart, the Synthetic Dimension does not seem to be an option here.

Steve_Street
Employee
Employee

Hi Joost,

You cannot apply this method to the combo chat - see  Combo chart seperate colours by expression

You can adjust the colours by re-ordering the measures

2014lightbars.JPG

2014darkbars.JPG

Or play around adding empty measures

2014custom.JPG

jananireddy
Partner - Creator
Partner - Creator

Hi Steve,

Is there a way to display legends for my chart when i use "color by expression" option in qlik sense.

How can i achieve it with the above illustration??

Steve_Street
Employee
Employee

Hi Janani,

There is currently no Legend option for color by expression. I have seen apps where an image has been created to display the legend. This does give you the ability to customise the look.

LegendCustom.PNG

jananireddy
Partner - Creator
Partner - Creator

Thanks Steve! I think this should help for now

Not applicable
Author

Great job!! Thanks a lot.

Tobias

jananireddy
Partner - Creator
Partner - Creator

By using a table i managed to show legends when color by expression was used.

My excel data has a column 'RGBVALUE' - this holds the RGB value against each row. example.png

Steve_Street
Employee
Employee

Good work! You might be interested in seeing how I extended this previously to create selectable color themes- Color Logic – loading multiple Color schemes

Not applicable
Author

Hello Steve,


Further to your solution.

I used ValueList the way you said and it really worked .

The problem is when I do selection model of the month, for example, the specific month stay in the right color and the rest of the line becomes the color of the second line.

Do you have a solution for this?

Thanks a lot,

gal