Focal Point
[SOLVED] MULTILINES on specific sort break

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

November 03, 2014, 11:09 AM
MartinY
[SOLVED] MULTILINES on specific sort break
Hi,

I have multiple SUBTOTAL breaks where I want to have some displayed all time and some only when multilines occurs.
I thought that having something like that will works:
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
BY SEATS
ON COUNTRY SUBTOTAL MULTILINES
ON CAR     SUBTOTAL
ON MODEL   SUBTOTAL MULTILINES
END


The problem is that using MULTILINES it's applied to all sort break as specified in doc.
quote:

MULTILINES
Suppresses the printing of a subtotal line for every sort break that has only one detail line, since the subtotal value is equal to this one value. Note that MULTI-LINES is a synonym for MULTILINES. MULTILINES is not supported with horizontal (ACROSS) sort fields.

SUMMARIZE
Recomputes values at every sort break.

RECOMPUTE
Recalculates values only at the specified sort break.


I'm wondering if it is possible to have MULTILINES react the same way as RECOMPUTE does : at specified sort break only ?
So I will always have SUBTOTAL for CAR, but only on MULTILINES for COUNTRY and MODEL.

All this without having to create the subtotals myself in a previous step and merging them to the detailed data where detail's row id will be 1 and subtotal will be 2 for then adding a sort on the row id after the BY SEATS (and the SUBTOTAL lines removed).

Is there another key word that I may not know yet ?

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
November 04, 2014, 01:20 AM
Ram Prasad E
You can use WHEN in subtotal, try below one.
SET LINES = 9999
DEFINE FILE CAR
MODEL_NEW/A50 = IF MODEL EQ '2002 2 DOOR AUTO' THEN '2002 2 DOOR' ELSE MODEL;
END
TABLE FILE CAR
SUM
COMPUTE CNTRY_CNT/I2=CNT.MODEL_NEW; NOPRINT
BY COUNTRY 
SUM 
COMPUTE MODEL_CNT/I2=CNT.SEATS; NOPRINT
BY COUNTRY 
BY CAR 
BY MODEL_NEW
SUM 
DEALER_COST
BY COUNTRY 
BY CAR 
BY MODEL_NEW
BY SEATS
ON COUNTRY SUBTOTAL
WHEN CNTRY_CNT GT 1;
ON CAR     SUBTOTAL
ON MODEL_NEW   SUBTOTAL 
WHEN MODEL_CNT GT 1;
ON TABLE SET STYLE *
TYPE=TITLE, BACKCOLOR=GREY, $
TYPE=SUBTOTAL, BY=COUNTRY, BACKCOLOR=BLUE, $
TYPE=SUBTOTAL, BY=CAR, BACKCOLOR=YELLOW, $
TYPE=SUBTOTAL, BY=MODEL, BACKCOLOR=RED, $
TYPE=GRANDTOTAL, BACKCOLOR=GREEN, $
ENDSTYLE
END


Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
November 04, 2014, 03:00 AM
Alan B
There is no keyword to achieve what you want, and Ram has one solution. I tend to use:
TABLE FILE CAR
SUM  DEALER_COST 
COMPUTE L_COUNTRY/A10 = LAST COUNTRY; NOPRINT
COMPUTE L_MODEL/A24 = LAST MODEL; NOPRINT
BY COUNTRY 
BY CAR 
BY MODEL 
BY SEATS 
ON COUNTRY SUBTOTAL WHEN COUNTRY EQ L_COUNTRY;
ON CAR SUBTOTAL 
ON MODEL SUBTOTAL WHEN MODEL EQ L_MODEL;
END



Alan.
WF 7.705/8.007
November 04, 2014, 07:27 AM
MartinY
Thanks for your solution, I'll try them.

Will be great if that keyword may exist...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007