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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display cost variance with calculated colour presentation

Hi all,

I have the following expression in a text box which I want to calculate the difference between the sum of NCOVAC in the current week and week-1 and calculate the positive/negative financial cost (£733/unit)

=(SUM({< Week_Class = {'Current Week'} >} NCOVAC) +

-

(SUM({< Week_Class = {'Week-1'} >} NCOVAC)))*733

This sum is working I.e. if there was 12 NCOVAC week-1 but 8 NCOVAC current week, I get -2932 (4 x 733) but when I adjust the number format settings to Money,I still cannot get the £ symbol.

I'd also like to display any negative cost difference as green and positive cost difference as red but I cannot get the RGB calculated colour settings right.

Thanks for any help.


Matt

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Instead of RGB you can use the Green() and Red() functions.

    For example

    if( condition >= 0,Red(),Green())

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks Kaushik but its still showing only green...

=IF(SUM({< Week_Class = {'Current Week'} >} NCOVAC) -

SUM({< Week_Class = {'Week-1'} >} NCOVAC)*733 >0, Red (255), Green(255))

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi

    Just give red(), not the Red(255). same for the green

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks Kaushik, the colour is working now. Any ideas on converting this to

=(SUM({< Week_Class = {'Current Week'} >} NCOVAC) -

(SUM({< Week_Class = {'Week-1'} >} NCOVAC)))*733 to show as £ value in LED textbox?