Forum Discussion
BRIANHINSHAW
3 years agoQrew Member
A QB Ninja helped clear this up for me and simplify the code.
If(IsNull([2022 Actual YTD]),"No Actuals",
Case(
[Measurement],
"Total",
"<div style='color: " & If([2022 Actual YTD] < [2022 Target Low],"#FF0000",[2022 Actual YTD] >= [2022 Target High],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([2022 Actual YTD],0.01),"none_dot")&Case([Metric Type],"Currency","M","Percent","%")&"</div>",
"Average",
"<div style='color: " & If([2022 Actual AVG YTD] < [2022 Target Low],"#FF0000",[2022 Actual AVG YTD] >= [2022 Target High],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([2022 Actual AVG YTD],0.01),"none_dot")&Case([Metric Type],"Currency","M","Percent","%")&"</div>",
ToText([2022 Actual AVG YTD])
)
)
------------------------------
BRIAN HINSHAW
------------------------------
If(IsNull([2022 Actual YTD]),"No Actuals",
Case(
[Measurement],
"Total",
"<div style='color: " & If([2022 Actual YTD] < [2022 Target Low],"#FF0000",[2022 Actual YTD] >= [2022 Target High],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([2022 Actual YTD],0.01),"none_dot")&Case([Metric Type],"Currency","M","Percent","%")&"</div>",
"Average",
"<div style='color: " & If([2022 Actual AVG YTD] < [2022 Target Low],"#FF0000",[2022 Actual AVG YTD] >= [2022 Target High],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([2022 Actual AVG YTD],0.01),"none_dot")&Case([Metric Type],"Currency","M","Percent","%")&"</div>",
ToText([2022 Actual AVG YTD])
)
)
------------------------------
BRIAN HINSHAW
------------------------------