Hi:
I'm not sure that the code you posted produces the output you showed. As an example, your PROC REPORT step shows
You show a CAS variable and a LEVEL variable and an M1%, M2% and M3% in the DEFINE statements, but you show M1% 3 times in the COLUMN statement and so I would expect your code to generate errors and no color coding or error prone color coding at all. Your output shows SEG and AMOUNT variables, but those aren't the labels in the PROC REPORT, so that is problematic.
Are your percent variables (which you have labelled M1%, M2% M3%) character or numeric? Based on your IF statements, my suspicion is that they are numeric, but I also suspect your code has other issues. Are your variables really named M1%, M2% and M3%? I would expect those variable names to generate errors in the SAS Log. Also, your M1, M2 and M3 variables are definitely numeric, but you don't show any SAS format in the DEFINE statement that would format the numbers with a COMMA format. In addition, your IF statement treats M1% as numeric with a value of .95 and .90, etc, but again, there's no format being used in the PROC REPORT step to format the decimal number as a percent.
Is it possible to see your SAS log that's generating the results you posted? I would be curious to see how your reference to M1%, M2%, etc is being handled.
There are a few different ways to handle having the percent columns with the same background color as the M1, M2 and M3 variables. One way is to use another CALL DEFINE in the COMPUTE block and an alternate way is to use traffic-lighting with a user-defined format for the percent variables and then a simplified COMPUTE block for the M1, M2 and M3 values.
Cynthia
With some fake data and different variable names, I think either of these examples will produce the report you want. Note that the second example has a simplified COMPUTE block, but the first example also works, although it is more verbose. ( I only typed a few rows of data since I had to make adjustments for the < and the % in the example data you posted.)
... View more