Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save $300 - Register for QlikWorld (formerly Qonnections) by January 31st: Learn More
Highlighted
Sera
New 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
Valued Contributor II

Re: Change Textcolor of a measure by just naming it

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
Partner
Partner

Re: Change Textcolor of a measure by just naming it

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

brunobertels
Valued Contributor II

Re: Change Textcolor of a measure by just naming it

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

Sera
New Contributor III

Re: Change Textcolor of a measure by just naming it

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
New Contributor III

Re: Change Textcolor of a measure by just naming it

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