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

Compare Columns in Straight Table - Use Column names in expression where Columns are NOT fields

I have several straight tables that look like the picture.  Each cell in table has a similar but different expression - columns are NOT fields. 

wttaryde_0-1602165250465.png

I need to color the background based upon comparing columns. Example Row 2:  if value in column 'FE 10' <= value in column 'Q1' shade cell blue

I can write that expression.  However, my table is built using a Value List.  So the expression for each cell is very long. To use that expression plus what's needed for the evaluation of color, the expression becomes nearly unmanageable.

What i need is a short cut.  That uses columns names and/or my value list.  Is there a way to reference column names in an expression.  Columns are NOT fields. 

 

3 Replies
Martijn_W
Contributor III
Contributor III

Have you tried using variables? Place the expression you use for a column in a variable, then use is for both the background color expression and the expression for the column in question.

That should do the trick.

wttaryde
Contributor III
Contributor III
Author

Thanks.  It's possible.  We'd have to wrap the variable in a bunch of code to get each column to be the distinct value we need, but variables would shorten the expression so it was manageable. I'll give it a try. 

wttaryde
Contributor III
Contributor III
Author

Just to add. We've had trouble using our expressions as variables for some reason, but they are working now and this solution is much better than the alternative.