Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Sera
Contributor III
Contributor III

Change Textcolor of a measure by just naming it

Hallo everyone, 

i'd like to know, if there's any way in QlikSense to change the textcolor of a measure (depending on it's value), by JUST NAMING it.

If([SaleCurrentYear (Vergleich Grosskunden)] < 0, red(), black())

itself doesn't work (says: 'wrong fieldname') - if i copy paste the full definition-formula of the measure into it instead, it works, but each of these definitions are several hundred lines of code long and it simply takes much more time to look up the definition everytime using it. Also hardcopying such measure-definitions make tiny future changes a pain... 

Is there a trick, how i can just name it?

1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi 

you can't change  the text color of a mesure by naming it or use the name of the master mesure you hac created. 

Nethertheless you can achieve your requierment by using variable 

 

create a variable and name it for exemple 

vMesure1 = sum(sales) 

 

then as color mesure use : 

if($(vMesure1) < 0, red(), black())

 

hope it helps

View solution in original post

4 Replies
gmenoutis
Partner - Creator II
Partner - Creator II

where are the definitions located? In variables? In some table? WHere did you copy-paste from?

brunobertels
Master
Master

Hi 

you can't change  the text color of a mesure by naming it or use the name of the master mesure you hac created. 

Nethertheless you can achieve your requierment by using variable 

 

create a variable and name it for exemple 

vMesure1 = sum(sales) 

 

then as color mesure use : 

if($(vMesure1) < 0, red(), black())

 

hope it helps

Sera
Contributor III
Contributor III
Author

Thanks @brunobertels  - this will surely does the trick...

I thought about this earlier, too - but it seems odd, that i can't just use a measure/'master-measure' instead. 

Often i really can't imagine, why QlikSense restrictions are, as they are (and remain like that)... 

Sera
Contributor III
Contributor III
Author

@gmenoutis :
I have defined measures like this one each as master element (not created via script)