Focal Point
[CLOSED] Hiding across columns conditionally.

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

March 29, 2012, 12:44 PM
Trayd21
[CLOSED] Hiding across columns conditionally.
Here is my issue. I have two fields of data that I want to display for one across, but only one each for my other two sets of data.

TABLE FILE SQLOUT
SUM
TRVL_MIN/I8 AS 'TRVL'
ONSITE_MIN/I8 AS 'ONSITE'
BY RGN
BY GM
BY APS
BY TECH
BY POST_DY AS 'DATE'
ACROSS CODE AS ''
ACROSS DESCRIPTION AS ''
ON RGN SUBTOTAL
ON GM SUBTOTAL
ON APS SUBTOTAL
ON TECH SUBTOTAL AS ''

So I want to display trvl and onsite for my assigned time, but only trvl for another and only onsite for yet another. Any ideas?

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


ver: 7610
geb: 093002009
March 29, 2012, 02:16 PM
RSquared
one way of doing this is by using the -SET command. eg

-SET &ACR1=IF my assigned time THEN 'ACROSS CODE' ELSE IF other cond1 THEN 'ACROSS CODE' ELSE '';
-SET &ACR2=IF my assigned time THEN 'ACROSS CODE' ELSE IF other cond2 THEN 'ACROSS CODE' ELSE '';

TABLE FILE SQLOUT
SUM
TRVL_MIN/I8 AS 'TRVL'
ONSITE_MIN/I8 AS 'ONSITE'
BY RGN
BY GM
BY APS
BY TECH
BY POST_DY AS 'DATE'
&ACR1
&ACR2
ON RGN SUBTOTAL
ON GM SUBTOTAL
ON APS SUBTOTAL
ON TECH SUBTOTAL AS ''


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
March 29, 2012, 03:10 PM
Dan Satchell
Something like this might work. You may need to add .EVAL to the variables (i.e., &FLG1.EVAL) in the TABLE request.

-SET &FLG1 = IF (display_condition1) OR (display_condition2) THEN ' ' ELSE '-*';
-SET &FLG2 = IF (display_condition1) OR (display_condition2) THEN ' ' ELSE '-*';
-*
TABLE FILE SQLOUT
SUM
&FLG1 TRVL_MIN/I8 AS 'TRVL'
&FLG2 ONSITE_MIN/I8 AS 'ONSITE'
BY RGN
BY GM
BY APS
BY TECH
BY POST_DY AS 'DATE'
ACROSS CODE AS ''
ACROSS DESCRIPTION AS ''
ON RGN SUBTOTAL
ON GM SUBTOTAL
ON APS SUBTOTAL
ON TECH SUBTOTAL AS ''



WebFOCUS 7.7.05
March 29, 2012, 03:41 PM
Trayd21
Neither of those seemed to work, thanks for the input. Is there just a way to hide my columns with all zeros in it? I tried HIDENULLACRS, but I think my subtotals are interferring.


ver: 7610
geb: 093002009
March 29, 2012, 04:32 PM
Crymsyn
I may be wrong but what you are wanting to to basically get rid of any across columns that your TRVL or ONSITE fields have only zeros in it?

The title of your request and first post at least for me was kind of confusing and sounded like you wanted the field that you have ACROSS to change.

If your problem is something similar to what happens in this example:
TABLE FILE CAR
SUM WEIGHT
BY COUNTRY
ACROSS MODEL
END


Then you can just do a WHERE statement on your SUM fields where they are NE 0. Example:

TABLE FILE CAR
SUM WEIGHT
BY COUNTRY
ACROSS MODEL
WHERE WEIGHT NE 0;
END


This way can cause problems with counts and averages and if I am still wrong sorry.


WF: 8201, OS: Windows, Output: HTML, PDF, Excel