Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Child_of_Bodom
Contributor
Contributor

Heatmap in table column - Variables not working

Hello everyone, 

I'm fairly new to Qlik so please excuse me, if this question is obvious. 

I have a table and I want to make a heatmap per column which is darkest at the highest number and lightest at the lowest number. Kinda like this: 

Child_of_Bodom_0-1738249613083.png

To do this, I have the following variables stored in my variables section: 

  • v_blue //this is just a colour variable
    value: ARGB($1,16,101,128)
  • vMax_x_je_y //this gives out the maximum x per y. In the example down below it gives the maximum sales volume of the current year ([Ums. BJ]) per product group (Produkgruppen)
    value: Max(Aggr($1, $2))

 

In the column that I want the heatmap to be in I then have the following syntax for the background colour: 
$(v_blue(([Ums. BJ] * 255) / $(vMax_X_je_Y([Ums. BJ], Produktgruppen))))

This gives me the following error: 
Error in expression: ')' or ',' expected
ARGB(([Ums. BJ] * 255) / Max(Aggr([Ums. BJ],16,101,128)

Obviously there are a few brackets missing here but I do not understand where they go missing. Both variables say that the syntax is fine. Does anyone have any idea here, how I could fix this? 

Many thanks in advance. 

 

Oh, and I want to give credit cause the idea isn't mine but taken from the Qlik App Analyzer App.

Labels (5)
1 Solution

Accepted Solutions
AnneEb
Contributor II
Contributor II

I would use a different approach and try colormix1 for what you are doing. This uses less variables and should give you the desired output as shown in your request. 

colormix1(Rank([Ums. BJ])/NoOfRows(TOTAL),rgb(16,101,128),rgb(255,255,255))

 

View solution in original post

4 Replies
marcus_sommer

At least in this is a missing bracket:

Max(Aggr([Ums. BJ],16,101,128)

But IMO several parts of your approach are looking suspicious and therefore I suggest that you check each single sub-part of all variables and calculations in separate expressions to ensure that they are working as expected because it could become quite hard to detect a mistake in such complex nested approach.

Child_of_Bodom
Contributor
Contributor
Author

I checked both variables individually and they are both working fine. The issue only seems to happen as soon as I use them together as shown above. As soon as I do this, some brackets go missing along the way. Could you maybe let me know which parts of my approch seem "suspicious" to you as you phrased it? I would love to investigate. 

marcus_sommer

Does the variables are containing an expression-string which should be evaluated in the context of the call or an already evaluated value - and does this result is containing a comma or any kind of quotes?

If yes, it will lead to trouble if they are combined or even nested in further calculations. As far as there is a comma in a variable-result it's not valid number anymore and nested in other variables the commas are treated as a parameter-delimiter.

AnneEb
Contributor II
Contributor II

I would use a different approach and try colormix1 for what you are doing. This uses less variables and should give you the desired output as shown in your request. 

colormix1(Rank([Ums. BJ])/NoOfRows(TOTAL),rgb(16,101,128),rgb(255,255,255))