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

Background Color Set Analysis

I created a simple table that has the line counts in two of our environments.

There is a dimension called 'Database' and there are two options its either 'TST' or 'PRD'

I have the line counts for each table.  I want to be able to highlight the line if TST does not equal PRD.  I am using the following expression in the background color area.

((SUM({<Database={'PRD'}>}BAR_CHARGES))<>(SUM({<Database={'TST'}>}BAR_CHARGES)),YELLOW(),WHITE())

If I use <> then it colors them yellow even if they match

((SUM({<Database={'PRD'}>}BAR_CHARGES))=-(SUM({<Database={'TST'}>}BAR_CHARGES)),YELLOW(),WHITE())

If I use =- then it leaves it white even if it doesn't match

What am I missing?

1 Solution

Accepted Solutions
Not applicable
Author

Hi Katie,

Indeed you need to use the Total qualifier in the background expressions to ignore the dimension.

However I attached a sample file in which i changed your data structure, having a simpler way to compare values in the expressions.

Just in case you see that such a change will be beneficial and/or feasible in your real application.

View solution in original post

8 Replies
MayilVahanan

Hi

May be try like this

=If( SUM({<Database={'PRD'}>}BAR_CHARGES) - SUM({<Database={'TST'}>}BAR_CHARGES) = 0, White(), Yellow())

Note:

Check either difference in decimal once.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

I think it is where set is not the best way.  Try this:

if(SUM(if(Database='PRD', BAR_CHARGES))<>SUM(if(Database='TST', BAR_CHARGES)),YELLOW(),WHITE())

Regards,

Michael

Not applicable
Author


Unfortunately neither option worked...

but thank you!

Anonymous
Not applicable
Author

Can you upload an example?  I suspect something small is missing...


jonathandienst
Partner - Champion III
Partner - Champion III

Is Database a dimension on your chart/table?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks for taking a look!  I am sure you are right, it has to be something simple I am overlooking.  I didn't think it was going to be a complicated issue.

Yes, database is a dimension!

JonnyPoole
Former Employee
Former Employee

The SET MODIFIER does not overule the same dimensional value that is in the chart column.  I modified your example to show this...

To workaround that premise i used the TOTAL arguement in the chart aggregation function to compare over and above the current dimensional value

from:

IF((SUM({<Database={'PRD'}>}BAR_CHARGES))<>(SUM({<Database={'TST'}>}BAR_CHARGES)),YELLOW(),WHITE())

to:

IF((SUM({<Database={'PRD'}>} total BAR_CHARGES))<>(SUM({<Database={'TST'}>} total BAR_CHARGES)),YELLOW(),WHITE())

It works for this isolated use case. Let me know if yours is more complex then your demo example and i'll try to adapt accordingly

Not applicable
Author

Hi Katie,

Indeed you need to use the Total qualifier in the background expressions to ignore the dimension.

However I attached a sample file in which i changed your data structure, having a simpler way to compare values in the expressions.

Just in case you see that such a change will be beneficial and/or feasible in your real application.