I'm attempting to do some conditional formatting in a value field. I'm in the Text Box Properties, Number, Custom, Expression. I'm trying to achieve different formats for a single value field. I'd like to have the format change based on a "code" (in my case metric_code) in the same query. What I'm getting is all values with the same format (example: 2.2000, 2500.0000, 2.5000).
Trying to Achieve:
If metric_code.value = "TOTAL_HRS_PCNT" then result should be 2.2%
If metric_code.value = "TOTAL_AMT_VARIANCE" then result should be $2,500
If metric_code.value = 'BTD_HRS_VARIANCE" then result should be 2.5
My script:
=switch(Fields!metric_code.Value = "TOTAL_HRS_PCNT", format(Fields!ALERT_VALUE.Value), "##
.##"+"%", Fields!metric_code.Value = "BTD_AMT_VARIANCE", format(Fields!ALERT_VALUE.Value), "$"+"##
.##",Fields!metric_code.Value = "BTD_HRS_VARIANCE", format(Fields!ALERT_VALUE.Value), "##
.##")
I've also tried:
=switch(Fields!metric_code.Value = "TOTAL_HRS_PCNT", "##.##"+"%",
Fields!metric_code.Value = "BTD_AMT_VARIANCE", "$"+"##.##",
Fields!metric_code.Value = "BTD_HRS_VARIANCE", "##.##")
Thanks in advance for taking the time to answer my question!