Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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

2 Replies
robert_mika
Master III
Master III

Where are you using this expression?

In the colors and legend part?

lironbaram
Partner - Master III
Partner - Master III

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