Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hlines_usacs
Creator II
Creator II

Color by Expression - Line Chart and Pie Chart

Hello,

I have a line chart and a bar chart in which I want to use the same expression to color.

Below is the expression and a screen shot of the two charts.

Is there a reason that they pie chart colors wouldn't work?

IF([Code] = '91'

,red()

    ,IF ([Code] = '83'

    ,blue()

        ,If(

 = '84'

            ,yellow()

        ,green()

                )

        )

   )

line and pie colors.jpg

25 Replies
agigliotti
Partner - Champion
Partner - Champion

I'm using June 2017 version and it works fine using both RGB and colors.

Did you select color by expression and checked "The expression is a color code" in "Color and legend" settings ?

hlines_usacs
Creator II
Creator II
Author

Yes, that option is selected.

Neymar_Jr
Creator II
Creator II

Hi hlines_usacs,

Can you please share the dimension and measure that you are using.


Regards,

Rajesh Thakur

Lucke_Hallbergson

An example from 3.2 SR4;
pick.wildmatch.png

shraddha_g
Partner - Master III
Partner - Master III

Do you have anything else in that Dimension except Number.

Because in screenshot something is blurred before numbers

hlines_usacs
Creator II
Creator II
Author

They are string values.

shraddha_g
Partner - Master III
Partner - Master III

did you use those actual values while comparing with Code field ?

pradosh_thakur
Master II
Master II

it seems to me like there is something wrong with where you are applying the expression. you need to check your measure too and make sure you use that back ground color of the dimension/expression. if possible share a sample document.

Learning never stops.
hlines_usacs
Creator II
Creator II
Author

This is the measure I am using.

SUM({<[Fact Type]={'Financial'},[Code]={'91','85','84','83'}>}[Encounters])

hlines_usacs
Creator II
Creator II
Author

Dimension:

[Code]

Measure:

SUM({<[Fact Type]={'Financial'},[Code]={'91','85','84','83'}>}[Encounters])