Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to use a custom expression to display a Green/Red color output on a donut chart, but nothing is working. I define anything null in the field as 'Unassigned' otherwise 'Assigned'. Here are the expressions involved.
Dimension
=if(IsNull([Resolution]), 'Unassigned', 'Assigned' )
Colors and Legend
=if(IsNull([Resolution), RGB(72,196,117), RGB(231,97,74))
Also tried
=if(IsNull([Resolution]), RGB(72,196,117), if(Not isNull([Resolution]), RGB(231,97,74), RGB(0,0,0)))
The only color displayed is Green (Not red for the Unassigned/Null values)
Or may be this -
Dimension - Aggr(if(isnull([Resolution]),'Unassigned','Assigned'),[Field])
and in the color by expression -
if(Aggr(if(isnull(Resolution),'Unassigned','Assigned'),[Field])='Unassigned',RGB(72,196,117), RGB(231,97,74))
try,
Pick(wildmatch(if(IsNull([Resolution]), 'Unassigned', 'Assigned' ), 'Unassigned', 'Assigned'),
RGB(72,196,117), RGB(231,97,74)
)
Hi Josh, Shraddha,
I am not sure why both of your expressions are not working.May be you can make some change to the load script.
Please check the attached app.
Cheers.
Once you use this in Load script you don't have to apply isnull() again in front end.
if you are using
if(IsNull([Resolution]), 'Unassigned', 'Assigned' ) as Resolution
in Load script.
You color by expression changes to pick(wildmatch(Resolution, 'Unassigned', 'Assigned'),
RGB(72,196,117), RGB(231,97,74)
)
Check Rajesh's modified app
Or may be this -
Dimension - Aggr(if(isnull([Resolution]),'Unassigned','Assigned'),[Field])
and in the color by expression -
if(Aggr(if(isnull(Resolution),'Unassigned','Assigned'),[Field])='Unassigned',RGB(72,196,117), RGB(231,97,74))
This is a very strange approach, but it works. Thanks for the tip.