Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
sjar1290
Contributor II
Contributor II

Display Background color

Hi All,

I need to achieve the following scenario.

I have a output like this:

Fields Access A Access B
Field 1 Yes No
Field 2 Yes No
Field 3 No Yes
Field 4 Yes No
Field 5 Yes No
Field 6 Yes No
Field 7 No Yes
Field 8 No Yes
Field 9 Yes No
Field 10 Yes No

 

But I need to achieve this, where ever 'Access A' has value 'NO' and 'Access B' has 'Yes' I need to display the background color as 'RED'

Instead of Yes and No, I am using Green tick Icon instead of Yes and Red hand Icon instead of No in the Qlik sense table chart.

How can I achieve this.

Any help would be much appreciated.

Thank you!

 

Labels (3)
6 Replies
ajaykakkar93
Specialist III
Specialist III

hi,
below is the code for the same 

data:
load * Inline [
Fields,Access A,Access B
Field 1,Yes,No
Field 2,Yes,No
Field 3,No,Yes
Field 4,Yes,No
Field 5,Yes,No
Field 6,Yes,No
Field 7,No,Yes
Field 8,No,Yes
Field 9,Yes,No
Field 10,Yes,No
];

Left Join (data)
// [Access A]: 

// add sumbol 
load * Inline [
Access A,Access Symbol A
Yes,▲
No,▼
];


Left Join (data)
// [Access B]:

// add sumbol 
load * Inline [
Access B,Access Symbol B
Yes,▲
No,▼
];


exit Script;




Background or Color expression 
=if([Access B] = 'Yes' , green(),red())

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

sjar1290
Contributor II
Contributor II
Author

Hi Ajay,

Thanks for the code.

but what I need is where ever Access A is 'NO' and Access B is 'YES' the background color should be RED() otherwise Green().

both these conditions should met (Access A is 'NO' and Access B is 'YES')

for Example: background color for rows of field 3, field 7 and field 8  should be RED()

I am using this expression

if(Access A='No',RED(), if(Acceess B ='Yes', RED(), Green()))

if(Access A='No',RED() and Acceess B ='Yes', RED(), Green())

But I am not getting the desires result with the above expressions.

please help me with the correct expression

 

Thank you!

QFabian
Specialist III
Specialist III

Hi @sjar1290 , you can try this expression in the table Chart Property Background Color expression, for each column of the table: 

if([Access A] = 'No' and [Access B] = 'Yes', lightred())

QFabian_0-1665010606751.png

 

QFabian
ajaykakkar93
Specialist III
Specialist III

hi,

below logic in color expression
=if([Access A] = 'No' and [Access B] = 'Yes' , red(),green())

 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

sjar1290
Contributor II
Contributor II
Author

Thank you for helping me.

ajaykakkar93
Specialist III
Specialist III

hi,
below is the code for the same 

data:
load * Inline [
Fields,Access A,Access B
Field 1,Yes,No
Field 2,Yes,No
Field 3,No,Yes
Field 4,Yes,No
Field 5,Yes,No
Field 6,Yes,No
Field 7,No,Yes
Field 8,No,Yes
Field 9,Yes,No
Field 10,Yes,No
];

Left Join (data)
// [Access A]: 

// add sumbol 
load * Inline [
Access A,Access Symbol A
Yes,▲
No,▼
];


Left Join (data)
// [Access B]:

// add sumbol 
load * Inline [
Access B,Access Symbol B
Yes,▲
No,▼
];


exit Script;




Background or Color expression 
=if([Access B] = 'Yes' , green(),red())

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting