Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Conditionally styling 3 value range (Traffic light)
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Conditionally styling 3 value range (Traffic light)
 Login/Join
 
Gold member
posted
I'm having issues conditionally styling 3 value ranges (red/yellow/green).

What am I missing here? I would have expected any value less than 12,000 to be Red.

TABLE FILE CAR
SUM
CAR.BODY.SALES
BY CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
DEFMACRO=GREEN,
MACTYPE=RULE,
WHEN=N2 GE 30000,
$
DEFMACRO=YELLOW,
MACTYPE=RULE,
WHEN=N2 LT 30000,
$
DEFMACRO=RED,
MACTYPE=RULE,
WHEN=N2 LE 12000,
$
TYPE=DATA,
COLUMN=N2,
COLOR='GREEN',
MACRO=GREEN,
$
TYPE=DATA,
COLUMN=N2,
COLOR='YELLOW',
MACRO=YELLOW,
$
TYPE=DATA,
COLUMN=N2,
COLOR='RED',
MACRO=RED,
$
ENDSTYLE
END

This message has been edited. Last edited by: Joel Elscott,


WebFOCUS 8.2.03
z/OS
 
Posts: 65 | Registered: May 20, 2013Reply With QuoteReport This Post
Expert
posted Hide Post
Try changing the order of the TYPE=DATA styling as the order gives precedence -

TYPE=DATA,
COLUMN=N2,
COLOR='GREEN',
MACRO=GREEN,
$
TYPE=DATA,
COLUMN=N2,
COLOR='RED',
MACRO=RED,
$
TYPE=DATA,
COLUMN=N2,
COLOR='YELLOW',
MACRO=YELLOW,
$


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Gold member
posted Hide Post
I've tried messing with the orders as well. In your example nothing turns yellow Frowner


WebFOCUS 8.2.03
z/OS
 
Posts: 65 | Registered: May 20, 2013Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Try this.
 
TABLE FILE CAR
SUM
CAR.BODY.SALES
BY CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
-*DEFMACRO=GREEN,
-*MACTYPE=RULE,
-*WHEN=N2 GE 30000,
-*$
-*DEFMACRO=YELLOW,
-*MACTYPE=RULE,
-*WHEN=N2 LT 30000,
-*$
-*DEFMACRO=RED,
-*MACTYPE=RULE,
-*WHEN=N2 LE 12000,
-*$
TYPE=DATA,
COLUMN=N2,
COLOR='GREEN',
WHEN=SALES GE 30000,
$
TYPE=DATA,
COLUMN=N2,
COLOR='YELLOW',
WHEN=SALES GT 12000,
$
TYPE=DATA,
COLUMN=N2,
COLOR='RED',
WHEN=SALES LT 12000,
$
ENDSTYLE
END
 
Posts: 92 | Registered: February 02, 2016Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks Pav, that worked! But I think there is a bug in the tool, this should work using the GUI. Glad I have a workaround though.


WebFOCUS 8.2.03
z/OS
 
Posts: 65 | Registered: May 20, 2013Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
In your example nothing turns yellow

That's because there is no value LT 30000 and GT 12000 that would trigger the condition. There is one that is exactly 12000 but that does not fall into the conditions that you supply.

The one that Pav shows would be the better option as it utilises the ordering precedence by correctly utilising the boundaries that you set.

Notice that the (effective yellow macro) uses GT 12000 as opposed to LT 30000 that you used. To get that one line to be coloured yellow, this should really be GE 12000 and the one for red should be LT 12000.

If you were to leave your original and change these boundaries, then you should get what you wanted.

And yes, this is possible in the GUI if you carefully set your boundaries.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Conditionally styling 3 value range (Traffic light)

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.