Hello, In my Report I used file more option to print the first row for summary line and using the summary line for calculation . The user don't want to see the summary line and just want to see detail line. I appreciate any one have thoughts on this issue....This message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8 Windows, All Outputs
October 29, 2018, 01:18 PM
BabakNYC
Could you provide a simple example of what you have right now? I'm not sure if I understand quite what's required.
WebFOCUS 8206, Unix, Windows
October 29, 2018, 01:25 PM
MartinY
Normally to remove a row you should use a WHERE clause.
One way I think that you should resolve your issue may be by HOLDing the result data meaning that instead of doing a report once your data is all calculated HOLD it to then print it from another TABLE FILE. But I may have miss something since your requirement is not much detailed.
Or you may use multi-verb TABLE FILE instead. It could be an option. below sample is calculating the ratio of RETAIL_COST on total DEALER_COST per COUNTRY.
TABLE FILE CAR
SUM DEALER_COST NOPRINT
BY COUNTRY
SUM COMPUTE RATE/D8.2C = RETAIL_COST / C1;
RETAIL_COST
BY COUNTRY
BY CAR
END
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
October 30, 2018, 07:59 AM
v_ani
Hello, Please see the sample of the car file . I am using first row for calculation the user don't want to see the summary line. Please let me know if you have any other suggestion to hide the first row....
TABLE FILE CAR
SUM
COMPUTE ZSORT/A2 = 'A';
DEALER_COST
BY COMPUTE CAR/A170 = '';
ON TABLE HOLD AS FACHS3A2
END
-RUN
TABLE FILE CAR
SUM
COMPUTE ZSORT/A2 = 'B';
DEALER_COST
COUNTRY
BY CAR/A170
ON TABLE HOLD AS FACHS3B2
END
-RUN
SET BYDISPLAY = ON
TABLE FILE FACHS3A2
SUM
DEALER_COST
BY ZSORT
BY CAR
ON TABLE HOLD AS TESTING
MORE
FILE FACHS3B2
END
TABLE FILE TESTING
SUM
DEALER_COST
COMPUTE TEST1/D12= IF CAR EQ '' THEN 1;
COMPUTE TEST2/D12= IF TEST1 EQ 1 AND ZSORT EQ 'A' THEN DEALER_COST;
COMPUTE TEST3/D12=DEALER_COST/TEST2 * 100;
BY ZSORT
BY CAR
END
-RUN
WebFOCUS 8 Windows, All Outputs
October 30, 2018, 08:51 AM
MartinY
Same sample as already provided with little changes
DEFINE FILE CAR
DUMMY /A1 = '';
END
TABLE FILE CAR
SUM DEALER_COST NOPRINT
BY DUMMY NOPRINT
SUM DEALER_COST
COMPUTE RATE/D12 = DEALER_COST / C1 * 100;
BY DUMMY NOPRINT
BY CAR
END
-RUN
Or from your own sample as I also already suggested
TABLE FILE CAR
SUM COMPUTE ZSORT/A2 = 'A';
DEALER_COST
BY COMPUTE CAR/A170 = '';
ON TABLE HOLD AS FACHS3A2
END
-RUN
TABLE FILE CAR
SUM COMPUTE ZSORT/A2 = 'B';
DEALER_COST
COUNTRY
BY CAR/A170
ON TABLE HOLD AS FACHS3B2
END
-RUN
SET BYDISPLAY = ON
TABLE FILE FACHS3A2
SUM DEALER_COST
BY ZSORT
BY CAR
ON TABLE HOLD AS TESTING
MORE
FILE FACHS3B2
END
-RUN
TABLE FILE TESTING
SUM DEALER_COST
COMPUTE TEST1/D12= IF CAR EQ '' THEN 1;
COMPUTE TEST2/D12= IF TEST1 EQ 1 AND ZSORT EQ 'A' THEN DEALER_COST;
COMPUTE TEST3/D12=DEALER_COST/TEST2 * 100;
BY ZSORT
BY CAR
ON TABLE HOLD AS RPTDATA
END
-RUN
TABLE FILE RPTDATA
SUM DEALER_COST
TEST3
BY ZSORT
BY CAR
WHERE CAR NE '';
END
-RUN
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
October 31, 2018, 11:17 AM
Hallway
Just run your first hold, then do a -READFILE to store the total as a parameter. You can then use the parameter in your calculations.
TABLE FILE CAR
SUM
DEALER_COST
ON TABLE HOLD AS FACHS3A2
END
-RUN
-READFILE FACHS3A2
SET BYDISPLAY = ON
TABLE FILE CAR
SUM
DEALER_COST
COMPUTE TEST1/D12= IF CAR EQ '' THEN 1;
COMPUTE TEST2/D12= &DEALER_COST.EVAL;
COMPUTE TEST3/D12= DEALER_COST/&DEALER_COST.EVAL * 100;
BY CAR
END
-RUN
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
October 31, 2018, 11:46 AM
Tony A
So essentially you are trying to calculate the percentage each line represents of the whole?
So the simplest method is to do a single pass of the data aggregating the values at the correct level before using them within your "TEST3" COMPUTE -
TABLE FILE CAR
SUM
DEALER_COST WITHIN TABLE NOPRINT
DEALER_COST WITHIN CAR
COMPUTE TEST3/D12=C2/C1 * 100;
BY CAR
END
-RUN
Essentially the same as Martin's first example with the newer method without using a multi verb request.
TThis message has been edited. Last edited by: Tony A,
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
October 31, 2018, 12:43 PM
Hallway
quote:
Originally posted by Tony A: So essentially you are trying to calculate the percentage each line represents of the whole?
So the simplest method is to do a single pass of the data aggregating the values at the correct level before using them within your "TEST3" COMPUTE -
TABLE FILE CAR
SUM
DEALER_COST WITHIN TABLE NOPRINT
DEALER_COST WITHIN CAR
COMPUTE TEST3/D12=C2/C1 * 100;
BY CAR
END
-RUN
Essentially the same as Martin's first example with the newer method without using a multi verb request.
T
For that matter, you can just use TOT. in your COMPUTE
TABLE FILE CAR
SUM DEALER_COST
COMPUTE TEST3/D12 = DEALER_COST / TOT.DEALER_COST * 100;
BY CAR
END
This message has been edited. Last edited by: Hallway,