Qlik Community

Qlik Sense App Development

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

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
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

 

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Unfortunately it didn't work.

The solution is to use the verb total

 

IF(xxx<>Above(Total(xxx),1)

View solution in original post

4 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Hi,

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

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Partner
Partner

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

Highlighted
MVP & Luminary
MVP & Luminary

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

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Partner
Partner

Unfortunately it didn't work.

The solution is to use the verb total

 

IF(xxx<>Above(Total(xxx),1)

View solution in original post