Focal Point
[SOLVED] BAD VALUE IN STYLESHEET- CONDITIONAL FORMAT ACROSS COMPUTE

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

January 07, 2010, 10:58 AM
BobV
[SOLVED] BAD VALUE IN STYLESHEET- CONDITIONAL FORMAT ACROSS COMPUTE
Hello all. I've viewed a number of post regarding a stylesheet error "bad value" but cannot seem to get a solution.
I am creating a report that computes the difference and % difference of columns after an ACROSS. I am trying to create a condition on the % change. Here's what I have and it was built in the GUI:
SUM
'CNT.CUSTOMER/I9C'
BY 'GROUP'
ACROSS 'MONTH'
COMPUTE DIFFERENCE/D12C = C2 - C1;
COMPUTE PERCENT_CHANGE/D12.3% = (DIFFERENCE / C1 ) * 100;
COMPUTE FLAG/A1 = IF ( PERCENT_CHANGE GT 5 ) THEN 'Y' ELSE 'N';
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
DEFMACRO=COND0001,
MACTYPE=RULE,
WHEN=FLAG EQ 'Y',
-* Bunch of styling follows this, then GUI
-* builds this:
$
TYPE=DATA,
COLOR='RED',
STYLE=BOLD,
MACRO=COND0001,
-* More styling
END

How does WF treat computed fields that need to come after an ACROSS? Does it not recognize them as legitimate fields?

Thanks all.

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


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
January 07, 2010, 11:41 AM
njsden
Hello BobV,

It seems like you cannot reference COMPUTE'd fields by name when they've been created after an ACROSS but you can reference them by position.

Your example leads me to think that the number of ACROSS values in your request is always the same (2 months) which simplifies things. I've worked out an example using the CAR table based on a similar post (Negative Red) which might be useful to your case:

TABLE FILE CAR
SUM SALES
BY CAR
ACROSS COUNTRY
COMPUTE DIFFERENCE/D12C = C2 - C1;
COMPUTE PERCENT_CHANGE/D12.3% = (DIFFERENCE / C1 ) * 100;
COMPUTE FLAG/A1 = IF ( PERCENT_CHANGE LT 0 ) THEN 'Y' ELSE 'N';
WHERE COUNTRY IN ('ENGLAND', 'JAPAN')
ON TABLE SET STYLE *
UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
DEFMACRO=COND0001, MACTYPE=RULE, WHEN=C5 EQ 'Y', $
TYPE=DATA, COLOR='RED', STYLE=BOLD, MACRO=COND0001, $
ENDSTYLE
END


The main point there is that the FLAG field is being referenced as C5 (positional notation) instead of by name and in that case the conditional style works.


Neftali.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
January 07, 2010, 12:28 PM
BobV
Neftali, thanks for the quick response. More importantly, thanks for the solution. This worked. The GUI could use a little help when dealing with this.
7.6.1 would not do it for me, perhaps 7.6.10 will once we get it.


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
January 07, 2010, 12:47 PM
njsden
You're very welcome. I'm glad it helped!

I totally agree with you on the need for a much better support on these and other features from the GUI in Dev Studio but for now we'll have to rely on the good ol' editor.

Cheers,
Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.