Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to find a way to color the output of an if statement. The function I'm using is below:
if((count(distinct{$ <[Fiscal Year] = {$(=MAX([Fiscal Year]))}>}[Product Number]) -count(distinct{$ <[Fiscal Year] = {$(=MIN([Fiscal Year]))}>}[Product Number])) > 0, '▲', '▼')
I'm wanting the upward carrot to be green and the downward carrot to be red. I attempted to encase them in Red() and Green() but then it showed up a large number instead of a red/green carrot.
Hi @amr_qlik ,
Add this expression in text color expression of your measure:
if((count(distinct{$ <[Fiscal Year] = {$(=MAX([Fiscal Year]))}>}[Product Number]) -count(distinct{$ <[Fiscal Year] = {$(=MIN([Fiscal Year]))}>}[Product Number])) > 0, lightgreen() ,lightred() )
Regards,
Aditya
I'm not seeing a text color expression box anywhere.
where do you apply this expression, i.e. what kind of object would you like to present this coloured symbol?
Currently, the object is in a KPI. I'm open to it being in another object if necessary, but only if it can be made large enough to be easily seen.
At least the ▼ character might be replaced by the inherently red unicode symbol 🔻
using Chr(128315) or '🔻' instead of '▼' in your expression.
There doesn't seem to be a green ▲ though...
Defining the colours should be possible in the Appearance/Color section.
Thank you. Chr(128315) combined with coloring the output green gets me where I want to be!
Is there a list of the available chr() characters somewhere I could look at?
You can make this list by yourself:
Symbols:
Load
Chr(RecNo()) as AsciiAlpha,
RecNo() as AsciiNum
autogenerate 20000
Where (RecNo()>=32 and RecNo()<=126) or (RecNo()>=160 and RecNo()<=13000)
;
Emojis:
Load
Chr(RecNo()) as EmojiAlpha,
RecNo() as ENum,
autogenerate 130000
Where (RecNo()>=127744 and RecNo()<=128317)
or (RecNo()>=128506 and RecNo()<=128591)
or (RecNo()>=128640 and RecNo()<=128709)
or (RecNo()>=128752 and RecNo()<=128762)
;