Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
sibideepak
Creator II
Creator II

is it possible to compare two dimensions value ??

Hi ,

Say for example if hav bar chart with month as dimension

and sales as measures ..

I want to compare sales each month with previous month and

change color (for example green,red)...

help me.

Thanks in advance,

Deepak Sibi

1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

=If(Above(Sum(Measure))>Sum(Measure), Green(), Red())            // background color expression

Similarly you can use Below() as well.

See attached sample too.

View solution in original post

6 Replies
tresB
Champion III
Champion III

Try like:

=If(Above(Sum(Measure))>Sum(Measure), Green(), Red())            // background color expression

Similarly you can use Below() as well.

See attached sample too.

sibideepak
Creator II
Creator II
Author

Thanks tresesco ,

Its working..

Actually i dont understand how it works ..

can you explain a bit ..??

And another doubt .. it s not properly working on line chart...

i.e) if line moves down it should appear red .

tresB
Champion III
Champion III

Above() - as the name says - it gets the value(expression here) of the earlier row. Then, rest part is simple comparison might not require explanation. For details, please refer help or reference manual.

sibideepak
Creator II
Creator II
Author

And while applying  it s not properly working on line chart...

i.e) if line moves down it should appear red .but not

tresB
Champion III
Champion III

Try to share your qvw with sample data. See: Preparing examples for Upload - Reduction and D... | Qlik Community

sibideepak
Creator II
Creator II
Author

Thanks ,

I tried and it works