Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Colour Dimensions in Script or in application Sense

Hi,

I have DocumentType Dimension- which has 3 types {Invoice, Credit Note, Cancelled}

I want these to be Invoice = lightGreen, Credit Note = lightRed , Cancelled = lightmagenta in pie chart and other graphs where this dimension has been used.

How can i do that?

I have tried this in the colour expression.

If(DocumentType = 'Invoice',Lightgreen(),

If(DocumentType = 'Credit Note',LightRed(),

If(DocumentType = 'Cancelled ',Lightmagenta(),)))


This is not working.


Can someone please suggest the right expression or if there is a way i can add this in the script and use that in the calculation.


Thanks

Tags (1)
2 Replies

Re: Colour Dimensions in Script or in application Sense

Where are you using this expression?

In the colors and legend part?

lironbaram
Honored Contributor II

Re: Colour Dimensions in Script or in application Sense

hi

you can do it like this

for example let assume this your table

load * inline [

F1 , F2 , F3

red1,"rgb(255,0,0)",3

Green1,"rgb(0,255,0)",2

blue1,"rgb(0,0,255)",4

];

now create a pie chart with F1 as dimension ,

sum(F3) as measure and

in the colors select color by expression

in the expression type =F2

Community Browser