Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator II
Creator II

Colour Change in Adhoc Report as per user selection

Hi,

I've Implemented Adhoc reporting in my app (Dimension and Measure) and based on user selection report is getting generated and is working fine. Now my user requirement is when they select value in Measure section color has to change accordingly.

For example I have Sales, Margin and Cost in my Measure, when user selects Sales and Margin from measure background color of Sales has to change as per below logic.

if Margin<=Sales, green()

if Margin>Sales,red()

Below is the data.

Table1:

Load * Inline[

Sales, Margin, Cost

100,200,300

200,100,300

300,200.600

];

Measures:

Load * Inline[

Measure, MeasureNo, MeasureFormulae

Sales, 1, SUM(Sales)

Margin, 2, SUM(Margin)

Cost, 3, SUM(Cost)

];

I've used below expression in background color change of table but when user selects Sales and Margin it is working and the color is also getting changed even if user select Sales and Cost, but My requirement is it has to change when user select Sales and Margin.

=if($(=FirstSortedValue([MeasureFormulae],[MeasureNo],2))<=$(=FirstSortedValue([MeasureFormulae],[MeasureNo],1)),Green(),
if($(=FirstSortedValue([MeasureFormulae],[MeasureNo],2))>$(=FirstSortedValue([MeasureFormulae],[MeasureNo],1)),LightRed(),White()))

Regards,

V Shana

1 Reply
vikasshana
Creator II
Creator II
Author

Can some one help me on this request please.