I have a task where I need to highlight a cell in an html output if its value falls outside a range (threshold value). The problem is, I have concatenated a value and its %Chg into a single variable for a better representation of the results in an output table. However, I need to highlight the cells based on the threshold values. Since, this new variable is a string (Character) it's not possible (or at least I don't know) to conditional format them on a basis of some numeric value.
diff[i] = comp[i]-base[i];
if base[i] > 0 then
pct_chg[i] = diff[i]/base[i] *100 ;
if pct_chg[i]=. then pct_chg[i]=0;
BASE_C[i] = right(put(diff[i],best.))|| "( " || strip(put(pct_chg[i],best.)) ||" % )";
Difference (%Change) section has columns which I need to format based on a threshold value (see attached). For example, if difference value or PCT value falls outside threshold say 5% then change the cell color to Red. Column "M 201707" under Difference (%Change) is created by using 2 variables,
Where, diff & pct_chg are numeric variables. Is there any way to accomplish this task, may be early in the code or in proc report?
