Focal Point
[SOLVED] Print two AS names for a column

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

June 27, 2018, 08:26 AM
pvijaysai
[SOLVED] Print two AS names for a column
I have a requirement to generate a report with column of data which needs to display in two cloumns :

Hold File Output:

CUSTOMER Level SENDER REQUESTS
319 1 AA 32
319 2 PH 12
319 3 AA 9
319 4 PH 5


Output to be printed:

CUSTOMER SENDER AA REQUESTS AA RESPONSES
319 1 32 25
319 3 9 4

CUSTOMER SENDER PH REQUESTS PH RESPONSES
319 2 12 22
319 4 5 7

TABLE FILE HLD_FINAL
PRINT
CUSTOMER_ID AS 'Customer'
-IF &SENDER.&I EQ 'PH' THEN GOTO PH_REP ELSE GOTO AA_REP;
-PH_REP
REQUESTS/D12C AS 'PH Reuests Received'
-GOTO END_REP;
-AA_REP
REQUESTS/D12C AS 'Requests Received'
-END_REP
ON CUSTOMER PAGE-BREAK
END

Tried with read file using loop.. but unable to print. Can you please suggest to print specific column AS name.
Thanks,
Vijay

This message has been edited. Last edited by: FP Mod Chuck,
June 27, 2018, 10:34 AM
Prarie
Not sure why you mean my able to print, are you not getting any output. Try adding a -RUN after END.
June 27, 2018, 10:35 AM
Frans
Do you want to have 2 outputs, or everything combined in one grid?

If combined, try using Subhead on SENDER, I think togheter with HEADALIGN for the titles you can can get it in one grid.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
June 27, 2018, 03:55 PM
Fernando
You can use a DEFINE

[/CODE]
DEFINE FILE HLD_FINAL
AA_REQUESTS/D12C=IF SENDER EQ 'AA' THEN REQUESTS ELSE 0;
PH_REQUESTS/D12C=IF SENDER EQ 'PH' THEN REQUESTS ELSE 0;
END
TABLE FILE HLD_FINAL
PRINT
CUSTOMER_ID AS 'Customer'
AA_REQUESTS AS 'Requests Received'
PH_REQUESTS AS 'PH Requests Received'
END
[/CODE]

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
June 28, 2018, 04:29 AM
pvijaysai
The output is with page break at sender level and at customer level and out of 4 rows from the final hold file the two column names should differ(AA Requests, PH Requests) for request for requests and responses which will be differentiated by Sender(AA/PH) column.

CUSTOMER LEVEL AA_REQUESTS AA_RESPONSES
319 1 32 25
319 3 9 4

CUSTOMER LEVEL PH_REQUESTS PH_RESPONSES
319 2 12 22
319 4 5 7


WebFOCUS 8

Windows, All Outputs
June 28, 2018, 10:14 AM
Doug
Please refer to This Post as it was answered there.