Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Partner
Partner

Qlik Sense, Set Text color expression by comparing columns using Above()

Hello,

I have this table, and I want to show the data in a table and based on the Type, I want to set a Text color expression

LOAD * INLINE [Id, Type,ModelName, ActivationTime, Value
1, 0, 'Alpha', 2019-01-01 12:35:22.400, 0
2, 0, 'Alpha', 2019-01-01 12:35:22.600, 0
3, 0, 'Beta',  2019-01-01 12:35:22.600, 0
4, 0, 'Beta',  2019-01-01 12:35:22.600, 1

5, 1, 'Alpha', 2019-01-01 12:35:22.400, 0
6, 2, 'Beta',  2019-01-01 12:35:22.400, 0

7, 1, 'Alpha', 2019-01-01 12:35:22.500, 0
8, 2, 'Alpha', 2019-01-01 12:35:22.600, 0

9, 1, 'Alpha', 2019-01-01 12:35:22.700, 0
10, 2, 'Alpha', 2019-01-01 12:35:22.700, 1
];

 

If Type=2, I want to compare the column value with the previous row and if there are not equal then I want to set a different color. I am using this condition for the columns ModelName, ActivationTime, Value

 

=IF(Type=1, RGB(0,0,255), IF(Type=2, IF(ModelName<>Above(ModelName,1), RGB(255,0,0))))

=IF(Type=1, RGB(0,0,255), IF(Type=2, IF(ActivationTime<>Above(ActivationTime,1), RGB(255,0,0))))

=IF(Type=1, RGB(0,0,255), IF(Type=2, IF(Value<>Above(Value,1), RGB(255,0,0))))

 

The problem is, that even if the values are equal, I get the red color for each column,row with Type 2

What am I doing wrong?

Colors.PNG

 

4 Replies

Re: Qlik Sense, Set Text color expression by comparing columns using Above()

Hi,

Use only one dimension and add all other as Expression and it will work.

Regards,

Kaushik Solanki

Partner
Partner

Re: Qlik Sense, Set Text color expression by comparing columns using Above()

Thank you for the fast reaction.

 

I am new in Qlik Sense.

What do you mean exactly with 'Use only one dimension and add all other as Expression'

 

BR

athinadev

Re: Qlik Sense, Set Text color expression by comparing columns using Above()

Hi,

What I mean by that is when you add table, just add one dimension (i.e ID in your case).

Rest all should be added as expression.

Regards,

Kaushik Solanki

Partner
Partner

Re: Qlik Sense, Set Text color expression by comparing columns using Above()

Unfortunately it didn't work.

I have attached a qvf file (main post) if you have time, you can give a look

Thanks in advance

athinadev