Focal Point
[SOLVED] possible to have this layout of a 2 layer hierarchy

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

October 30, 2008, 08:44 AM
MTO-Solutions-Engineering
[SOLVED] possible to have this layout of a 2 layer hierarchy
Spent some time scanning through several of the 5.x manuals. Still unsure if this format is even possible. MULTILINES allows similar but not quite.

Let's start with this

TABLE FILE CAR
PRINT BODY.SALES
BY    COMP.CAR
BY    CARREC.MODEL
ON COMP.CAR SUBTOTAL MULTILINES
ON TABLE SET PAGE-NUM OFF 
ON TABLE COLUMN-TOTAL AS 'Totals'


which results in this

  
CAR          MODEL                  SALES 
-----        -------------          -----
ALFA ROMEO   2000 4 DOOR BERLINA     4800 
             2000 GT VELOCE         12400 
             2000 SPIDER VELOCE     13000 
  
*TOTAL CAR ALFA ROMEO               30200 

AUDI         100 LS 2 DOOR AUTO      7800 
  
BMW          2002 2 DOOR             8950 

etc.

In our data, the corresponding strings that replace Car and Model are both longer, and so to save on page real estate the group wants this style

ALFA ROMEO                 30200
    2000 4 DOOR BERLINA     4800 
    2000 GT VELOCE         12400 
    2000 SPIDER VELOCE     13000 
  
AUDI                        7800 
  
BMW                        80390
    2002 2 DOOR             8950 

etc.

Is this possible, and if so, please head me in the right direction (and I will continue my research).

thank you

Richard

This message has been edited. Last edited by: MTO-Solutions-Engineering,


MTO
WebFOCUS Dev Studio 5.3.2 (trying to upgrade to 7.x !)
Unix with Win XP front ends
output usually PDF (and some HTML and XLS at times)
October 30, 2008, 09:29 AM
Francis Mariani
Richard,

People usually use SUBHEAD or SUBFOOT if they require the SUBTOTAL line to appear different than the default.

The following example doesn't produce exactly what you require, but it is a suggestion you could build on.

TABLE FILE CAR
SUM
COMPUTE SALEST/D10 = SALES; NOPRINT
BY CAR NOPRINT
SUM
SALES/D10
BY CAR NOPRINT
BY MODEL
ON CAR SUBHEAD
"<CAR<SALEST"

ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
TYPE=SUBHEAD, HEADALIGN=BODY, STYLE=BOLD, $
TYPE=SUBHEAD, ITEM=2, JUSTIFY=RIGHT, $
ENDSTYLE
END

If you need to indent the detail lines, styling (dependent on the output type) can be used.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 30, 2008, 09:37 AM
GinnyJakes
How about this:

SET SHOWBLANKS=ON
DEFINE FILE CAR
SORTFLD2/I2=1;
MODELSORT/A30=CAR;
END
TABLE FILE CAR
SUM SALES
COMPUTE SORTFLD1/I2=IF CAR NE LAST CAR THEN SORTFLD1+1 ELSE SORTFLD1; NOPRINT
BY TOTAL SORTFLD1
BY SORTFLD2
BY  CAR
BY  MODELSORT
ON TABLE HOLD AS CARHOLD FORMAT ALPHA
END
DEFINE FILE CAR
MODELSORT/A30='    '|MODEL;
END
TABLE FILE CAR
SUM SALES
COMPUTE SORTFLD1/I2=IF CAR NE LAST CAR THEN SORTFLD1+1 ELSE SORTFLD1; NOPRINT
COMPUTE SORTFLD2/I2=IF CAR NE LAST CAR THEN 2 ELSE SORTFLD2+1;
BY  CAR
BY TOTAL SORTFLD1
BY  MODELSORT
ON TABLE HOLD AS MDLHOLD FORMAT ALPHA
END
TABLE FILE CARHOLD
PRINT SALES
BY SORTFLD1 NOPRINT
BY SORTFLD2 NOPRINT
BY MODELSORT AS ''
MORE 
FILE MDLHOLD
END



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 30, 2008, 09:54 AM
MTO-Solutions-Engineering
Thank you Francis and Ginny for quick replies.

The one from Francis is obviously a bit easier to understand, and the one from Ginny amazed me in that the blanks before the names are preserved in HTML. It is obviously the SHOWBLANKS setting, but I cannot find it mentioned in any of our manuals!!! (I just did a search through over a dozen PDF files we have collected from WebFOCUS for 5.3 and no SHOWBLANKS!)

I have tested both suggestions and what both do not answer is how to do a MULTILINES style, in that for companies like AUDI, (which has only one model) we do NOT want the model listed.

Richard


MTO
WebFOCUS Dev Studio 5.3.2 (trying to upgrade to 7.x !)
Unix with Win XP front ends
output usually PDF (and some HTML and XLS at times)
October 30, 2008, 10:09 AM
GinnyJakes
Sorry but SHOWBLANKS came along in the 7.6 release. You could probably get around that by concatenating an unprintable character in front of the model. I apologize for not paying attention.

As for not displaying the model for Audi, I'm sure that you can take the counts I created and do additional testing to determine whether you should print the line or not.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 30, 2008, 10:47 AM
MTO-Solutions-Engineering
Interesting !!!

I am definitely using 5.3.2 and ...

SET SHOWBLANKS=ON

results in indentations working

and ...

-* SET SHOWBLANKS=ON

results in indentations NOT working.

Are you sure they did not have it in there all along but only announced it in 7? Smiler

Richard


MTO
WebFOCUS Dev Studio 5.3.2 (trying to upgrade to 7.x !)
Unix with Win XP front ends
output usually PDF (and some HTML and XLS at times)
October 30, 2008, 11:11 AM
GinnyJakes
Could have been. I'm glad it's working for you.

If you are up to a challenge, you could probably do my example with the MacGyver techniques and eliminate a pass of the data. Or do the detail hold first then the summary hold from the detail hold.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 30, 2008, 03:56 PM
MTO-Solutions-Engineering
I will play with this some more and post my findings


Richard


MTO
WebFOCUS Dev Studio 5.3.2 (trying to upgrade to 7.x !)
Unix with Win XP front ends
output usually PDF (and some HTML and XLS at times)