Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Change chart's color

Hello

I have a line chart where: 
DVPG is a Date dimension, and this is the expression: 

=avg({1 <STCK={'CVCB3'}, DVPG={">$(=Date(Addmonths(Today(), -3)))"}>} VDAF)

 

Now, I would like to color the entire chart based on the comparison between the last two available value of VDAF for STCK='CVCB3'... how can I do it?

I would like to do something like this:

=If(firstsortedvalue(VDAF, -DVPG, 1) > firstsortedvalue(VDAF, -DVPG, 2), color(2), color(3))
But his expression must consider only the STCK=CVCB3

 

How can I do it?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You can include similar set analysis in firstsortedvalue(), like:

=If(firstsortedvalue( {<STCK={'CVCB3'}>} VDAF, -DVPG, 1) > firstsortedvalue({<STCK={'CVCB3'}>} VDAF, -DVPG, 2), color(2), color(3))

View solution in original post

1 Reply
tresesco
MVP
MVP

You can include similar set analysis in firstsortedvalue(), like:

=If(firstsortedvalue( {<STCK={'CVCB3'}>} VDAF, -DVPG, 1) > firstsortedvalue({<STCK={'CVCB3'}>} VDAF, -DVPG, 2), color(2), color(3))