Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
24_02_SRR
Contributor III
Contributor III

QlikSense Table column Background Color logic with Alternate State filter

Hi Everyone,

I need help on the Background color logic. In QlikSense table, I have one dimension column with 4 to 5 concatenate fields. like ID &'-'& Name &'-'& Address &'-'& ContactNo &'-'& Month

213-AAA-XYZ-56739-Apr
563-BBB-YNB-78654-May
745-CCC-YGD-45976-Jun
356-DDD-YGD-29747-
198-EEE-XYZ-46954-

 

Color Logic:

If the Month value is Previous month means always it should be in Yellow. if the month is not Previous month then we need to show it as Light green. suppose they select any values on the table that cell should be highlighted as Darker green but yellow should be maintain the same color and the Unselected values should be light green.

Note: I'm using Alternate state (GWA Requirement) in my table based on requirement.

My Background color condition 

if(MonthFlag='PreviousMonth','#ffbc3d',
if(GetFieldSelections(ID,',',100,'GWA Requirement' )=ID and MonthFlag='PreviousMonth','#ffbc3d',
if(GetFieldSelections(ID,',',100,'GWA Requirement' )=ID and MonthFlag<>'PreviousMonth','#57C880',
if(GetFieldSelections(ID,',',100,'GWA Requirement' )<>ID and MonthFlag<>'PreviousMonth','#c1e6ce',
'#ffbc3d'))))

It's partially work for me. all the conditions work. except when they select "Not Previous month" ID value , the "Previous Month" ID color changed as lighter green. It's wrong.

EX: Without any selection

213-AAA-XYZ-56739-Apr
563-BBB-YNB-78654-May
745-CCC-YGD-45976-Jun
356-DDD-YGD-29747-
198-EEE-XYZ-46954-

 

Select the "Not Previous Month" value - Jun (here yellow should maintain the same)

213-AAA-XYZ-56739-Apr
563-BBB-YNB-78654-May
745-CCC-YGD-45976-Jun
356-DDD-YGD-29747-
198-EEE-XYZ-46954-

 

Select the "Previous Month" value - Apr 

213-AAA-XYZ-56739-Apr
563-BBB-YNB-78654-May
745-CCC-YGD-45976-Jun
356-DDD-YGD-29747-
198-EEE-XYZ-46954-

 

Kindly help on this. to write a correct expression

Thanks for your help😊

Labels (2)
1 Solution

Accepted Solutions
24_02_SRR
Contributor III
Contributor III
Author

Finally, I found the Solution.

if((count({<ID=,Name =,Address =,ContactNo =, Month=,MonthFlag={'PreviousMonth'}>}ID))>0,'#ffbc3d',
if(GetFieldSelections(ID,',',100,'GWA Requirement' )=ID and
MonthFlag<>'PreviousMonth','#57C880',
if(not GetFieldSelections(ID',',100,'GWA Requirement' )=ID and
not MonthFlag='PreviousMonth'','#c1e6ce')))

Thanks for the help.

View solution in original post

3 Replies
Chanty4u
MVP
MVP

Try this and pls chk the braces

if(MonthFlag='PreviousMonth',

    if(GetSelectedCount({<MonthFlag={'PreviousMonth'}>} ID)>0, '#ffbc3d', '#ffbc3d'),

    if(GetSelectedCount({<MonthFlag={'PreviousMonth'}>} ID)>0, '#57C880',

        if(GetSelectedCount({<MonthFlag={'PreviousMonth'}>} ID)=0, '#c1e6ce', '#ffbc3d')

   

)

)

24_02_SRR
Contributor III
Contributor III
Author

Thanks for your valuable reply.

It's not working, Even I closed the brackets but I'm getting the error message.

If I remove this part from getselectedcount, the error message is gone. 

{<MonthFlag={'PreviousMonth'}>}

24_02_SRR
Contributor III
Contributor III
Author

Finally, I found the Solution.

if((count({<ID=,Name =,Address =,ContactNo =, Month=,MonthFlag={'PreviousMonth'}>}ID))>0,'#ffbc3d',
if(GetFieldSelections(ID,',',100,'GWA Requirement' )=ID and
MonthFlag<>'PreviousMonth','#57C880',
if(not GetFieldSelections(ID',',100,'GWA Requirement' )=ID and
not MonthFlag='PreviousMonth'','#c1e6ce')))

Thanks for the help.