Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Color the Columns???

Hi,

I got a column like below where I want to color If Actual is more than plan green or if plan more than actual red

I used below query in "actual's" background color, it worked but if you notices below table there are empty column and "N/A" in actual column where I want make both white and if it's "N/A" I want to display that on my straight table. please help me on this... how do I do that?

  • if(Avg([Plan])> Avg([Actual),RGB(255,99,71),RGB(50,205,50))


  • If Plan is more than Actual = RED or If Actual is more than Plan = GREEN

       and if the cell has the letter "NA" it should read the letter "NA" and the cell should be = WHITE


PlanActual
80%45%
50%50%
60%N/A
100%100%
0%0%
100%100%
90%90%
--
100%N/A
100%70%
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

Try below script instead.

If(Avg([Plan])>Avg([Actual]), RGB(255,99,71),

If(Avg([Plan])<=Avg([Actual]), RGB(50,205,50), White()))

View solution in original post

9 Replies
sujeetsingh
Master III
Master III

If plan is your field then write nested if , as  click on expression'+'  sign then comes option of Background colour

and then write your condition

sujeetsingh
Master III
Master III

See this sample please

vikasmahajan

you can use visual cuves with conditions and colour which you required from presentation tab

Hope this helps you.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
PrashantSangle

Hi,

Try this in Background Color Expression.

if((Actual)='NA',rgb(0,0,0),if(if(Avg([Plan])> Avg([Actual),RGB(255,99,71),RGB(50,205,50))))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

thank you!

but if you have notice my post, I said that I want to add 3 color

such as;

1. if <= 50  green

2. if >50 red

3. if 'NA' white

Anonymous
Not applicable
Author

Hi,

Try below,

If(Actual='NA', RGB(0,0,0), If(Avg([Plan])>Avg([Actual), RGB(255,99,71), RGB(50,205,50)))

Not applicable
Author

thanks!

I want to can I can process the query in the straight chat? coz in the straight it shows 'NA' as '-'

and its only showing RED and GREEN. please find the QVD in the attachment

Anonymous
Not applicable
Author

Hi,

Try below script instead.

If(Avg([Plan])>Avg([Actual]), RGB(255,99,71),

If(Avg([Plan])<=Avg([Actual]), RGB(50,205,50), White()))

Not applicable
Author

Thank you so much!!!