Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Partner
Partner

Using colors for Master measure for conditional values

Hello guys!!

Need your help on below case. 

I have a requirement where i wanted to show text with measure value and i also want the measure value to be given in colors according to my condition. Since the data is confidential im providing you with sample.

Eg: My sales Increased by 10%( 10million from 5million in May'19 (Take previous month)) 

now 10% should be shown in green colour when current sale is greater than previous month sale and it should show red when previous sale is greater than current month sale.

I even tried adding as master measure but i can give either the whole text in same color or if i use segment color i must add limit where i need to enter value manually.. ( this value takes few expressions with so many conditions in my case) which will not work.

This must be shown as Single measure only. 

Thanks in Advance 🙂

-Nive

Labels (1)
3 Replies
Highlighted
Partner
Partner

Re: Using colors for Master measure for conditional values

in ur chart, color by expression:

assume ur measure is :sum (Sales)

the color would be sthing like:

if(sum(Sales) >= above(sum(Sales)),green(),red())

per analogy:

Capture.PNG

Highlighted
Partner
Partner

Re: Using colors for Master measure for conditional values

Thanks Omar. but my requirement is to bring text with measure values as a KPI only
"My sales Increased by 10%( 10million from 5million in May'19)"
only 10% should have the colour changes.
Highlighted
Partner
Partner

Re: Using colors for Master measure for conditional values

Same logic : 

 

if(
(sum( Sales)

- above(
sum( Sales))) / above(
sum( Sales)) >0.1

,green(),red())

 

Result:

Capture.PNG

 

Or increase by 10% or more : green

0 to 10% : grey

decrease : red 

 

if(

sum(Sales)< above(sum(Sales)),red(),

if((sum( Sales)

- above(
sum( Sales))) / above(
sum( Sales)) >0.1

,green(),'grey'))

 

Result:

Capture.PNG