Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How to optimize below expression the best way either in load script or in front end.
if(round(sum(total<XYZ, ABC> Aggr(sum({1<PQR={0},EFG=p(EFG)>}HEADCOUNT),XYZ, ABC)),.01)>1,
RGB(255,106,106), //red
if(round(sum(total<XYZ, ABC> Aggr(sum({1<PQR={0},EFG=p(EFG)>}HEADCOUNT),XYZ, ABC)),.01)=1,
RGB(0,232,116), //green
Yellow()))
Currently its written in chart expression background color expression.
It's taking too long time to load the table.
Thanks & Regards,
Udit
Not sure why you need Aggr() function here, from what I know (and AFAIK)
This
Sum(total<XYZ, ABC> Aggr(sum({1<PQR={0},EFG=p(EFG)>}HEADCOUNT),XYZ, ABC))
Should equal this
Sum({<PQR={0},EFG=p(EFG)>}HEADCOUNT)
Unless you have missed more dimensions in your Aggr() function. Notice, I removed 1 from the set analysis above. So may be try this:
If(Round(Sum({<PQR={0},EFG=p(EFG)>}HEADCOUNT), .01) > 1, RGB(255,106,106), //red
If(Round(Sum({<PQR={0},EFG=p(EFG)>}HEADCOUNT), .01) = 1, RGB(0,232,116), //green
Yellow()))