Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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
its_anandrjs

Try this you have some extra comma may be please check this now

IF( [Code] = 91,red(),

IF( [Code] = 83,blue(),

If(

  = 84,yellow(),green() )))

hlines_usacs
Creator II
Creator II
Author

That did not work. I also tried putting the values inside single quotes and that did not work either.

shraddha_g
Partner - Master III
Partner - Master III

in Color by Expression,

Pick(wildmatch([Code],'91','83','84','85'),

red(),

blue(),

yellow(),

green()

)

or

Pick(wildmatch(

,91,83,84,85),

red(),

blue(),

yellow(),

green()

)

Chanty4u
MVP
MVP

Expression seeem correct,

did you tried with RGB values instead of  red,green,yellow?   try once

saurabh_karlewar
Contributor III
Contributor III

Expression looks OK.

It works form me with red, green,yellow and blue functions. However does not work with RGB values.

hlines_usacs
Creator II
Creator II
Author

Neither of these worked. I tried RGB values and those did not work either.

OmarBenSalem

What version are you using?

hlines_usacs
Creator II
Creator II
Author

3.4 SR 4

OmarBenSalem

Can u please share with me a "test app" containing only these 2 charts?