Focal Point
[SOLVED] Conditional style

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6857009395

November 18, 2010, 02:00 PM
Enigma006
[SOLVED] Conditional style
Hai all

I am very new to WF. I am working on conditional styling. I am able to complete few of them but stuck at one point. Can someone suggest me how to do this.

  
TABLE FILE CAR
PRINT 
     SALES
BY COUNTRY
BY CAR
BY MODEL
END


Its like I want to color sales values green and red based on prior values. If current record sales values is more than sales value of prior record make it green else make it red. Something like this..Or one criteria I could think of is sales by years..say 2008, 2009 and 2010. If sales of 2009 is more than 2008, make it green or red and same with 2010 and 2009.

Thanks a lot..

This message has been edited. Last edited by: Kerry,


8.1.05
HTML,PDF,EXL2K, Active, All
November 18, 2010, 02:15 PM
BlueZone
DEFINE FILE CAR
FLG_SLS/A1 = IF SALES GT LAST SALES THEN 'G' 
ELSE IF SALES LT LAST SALES THEN 'R' ELSE 'X';
END
TABLE FILE CAR
PRINT 
     SALES  FLG_SLS
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=SALES,COLOR=RED,WHEN=FLG_SLS EQ 'R',$
TYPE=DATA,COLUMN=SALES,COLOR=GREEN,WHEN=FLG_SLS EQ 'G',$
ENDSTYLE
END
-EXIT  


You could tweak it to do what ever sum/sort you need to do and suppress the FLG field once you are satisfied with what its doing.


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
November 18, 2010, 02:21 PM
Enigma006
thanks bluezone..its working great and I can make modifications as needed for me.
I will make flag as noprint..


8.1.05
HTML,PDF,EXL2K, Active, All