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

colour coding in straight table

hi guys,

I have an issue regarding with the colour coding to the text in straight table the requirement, in a expression field 1 is grater than field 2, then test values should be change like this .

screenshot.png

6 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

So what you want to achieve is if Field1 is greater than Field2 then the background of field1 to be red? If that's correct then copy your expression from Expression atb (from test) click the + sign and copy the expression you have there. Now go to Dimensions tab click + sign for FIELD1 click Background Color and click on Edit then paste your copied expression there. Finally click Ok. That should be it

Here is your expression

if(FIELD1>FIELD2,RGB(300,0,0))

Hope this helps

Not applicable
Author

Hi Gabriel,

thanks for reply i know that but requirement is i need just change color of field1. i'm getting 24/21 is in red i want 24 is in red and 21 should be black

example:     red            black

                     24     /     21

                    27      /     21

                    31     /     21

awhitfield
Partner - Champion
Partner - Champion

You code actually says if the value in field1 is greater than the value fin Filed2 then make the text colour of the value in TEST red!

That's what it's doing, you need to add the colour expression to the text colour property on the Filed1 dimension instead

Andy

Not applicable
Author

Hi Andrew,

Thanks for reply.i need like this.please help mescreenshot.png

sunilkumarqv
Specialist II
Specialist II

give this below exp in Dimension FIELD1

IF(Field1>Field2,Red())

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Quick question.

Must you concatenate Field1 and Field2? Can you not leave it separate? This will make it easier to highlight whichever is greater between both field. And if you must concatenate both fields then here's my suggestion.

Have 1 more expression using

=if(FIELD1 > FIELD2, FIELD1 ,FIELD2)  // in the expression tab

Label it as Test2

Then in the Text Color (click + sign from Test2 ) and enter

=if(FIELD1 > FIELD2,RED())

Hope this make sense and helpful