Conditional Styling
Conditional Styling
(OP)
Hello,
I'd like to color some fields in my report. The cells of one column (MYFIELD in the example below) should be green, yellow, red depening on the value they contain:
value <= 5 : green
value > 5.01 and < 7.5 : yellow
value >= 7.5 : red
I did the red and green like this:
DEFMACRO=COND0001, MACTYPE=RULE, WHEN=MYFIELD LE 5, $
DEFMACRO=COND0003, MACTYPE=RULE, WHEN=MYFIELD GE 7.5, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0001, COLUMN=MYFIELD, BACKCOLOR=GREEN, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0003, COLUMN=MYFIELD, BACKCOLOR=RED, $
This works fine. Yet I have a problem with the yellow condition. I want the value of MYFIELD to be between two numbers. I tried to simply add
DEFMACRO=COND0002, MACTYPE=RULE, WHEN=ARCKST GT 5.01, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0002, COLUMN=MYFIELD, BACKCOLOR=YELLOW, $
or this:
DEFMACRO=COND0002, MACTYPE=RULE, WHEN=ARCKST GT 5.01 AND LT 7.5, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0002, COLUMN=MYFIELD, BACKCOLOR=YELLOW, $
But neither worked. Can anybody tell me how to do it right?
Thanx a lot,
Eva
I'd like to color some fields in my report. The cells of one column (MYFIELD in the example below) should be green, yellow, red depening on the value they contain:
value <= 5 : green
value > 5.01 and < 7.5 : yellow
value >= 7.5 : red
I did the red and green like this:
DEFMACRO=COND0001, MACTYPE=RULE, WHEN=MYFIELD LE 5, $
DEFMACRO=COND0003, MACTYPE=RULE, WHEN=MYFIELD GE 7.5, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0001, COLUMN=MYFIELD, BACKCOLOR=GREEN, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0003, COLUMN=MYFIELD, BACKCOLOR=RED, $
This works fine. Yet I have a problem with the yellow condition. I want the value of MYFIELD to be between two numbers. I tried to simply add
DEFMACRO=COND0002, MACTYPE=RULE, WHEN=ARCKST GT 5.01, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0002, COLUMN=MYFIELD, BACKCOLOR=YELLOW, $
or this:
DEFMACRO=COND0002, MACTYPE=RULE, WHEN=ARCKST GT 5.01 AND LT 7.5, $
TYPE=DATA, JUSTIFY=RIGHT, MACRO=COND0002, COLUMN=MYFIELD, BACKCOLOR=YELLOW, $
But neither worked. Can anybody tell me how to do it right?
Thanx a lot,
Eva
RE: Conditional Styling
CODE
WHEN=LINEPRICE GT 500000,$
TYPE=DATA, BACKCOLOR=YELLOW, STYLE=BOLD,
WHEN=LINEPRICE GT 400000,$
which says, in the note:
The first conditional declaration formats any rows whose order total is greater than 500,000.
The second conditional declaration formats any rows whose order toal is greater than 400,000 and less than or equal to 500,000.
This is on page 24-8 of the 7.1 WebFOCUS Creating Reports manual.
RE: Conditional Styling