Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Getting a Totals report from 2 other reports

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Getting a Totals report from 2 other reports
 Login/Join
 
<d3nis370>
posted
I am making 2 reports a summary report and a totals report.
Here is the code for the summary report. It builds 2 different summary reports (check log endore and deposits summary).
  
DEFINE FILE FDI002
P9dateofdispo/P9=
IF FDI002.FDI002.FDI002_CHECK_STATUS EQ 'P'
THEN FDI002.FDI002.FDI002_CK_SENT_DT
ELSE FDI002.FDI002.FDI002_PROCESS_DT;
I8YYMDdateofdispo/I8YYMD=P9dateofdispo;
YYMDdateofdispo/YYMD=I8YYMDdateofdispo;
MonthYear/MtrYY=I8YYMDdateofdispo;
daysoutstanding/P9=P9dateofdispo - FDI002.FDI002.FDI002_CK_RCVD_DT;
ckrelday1/P9=
IF daysoutstanding LE 1
THEN + 1
ELSE + 0;
ckrelday2/P9=
IF daysoutstanding EQ 2
THEN + 1
ELSE + 0;
ckrelgt2day/P9=
IF daysoutstanding GT 2
THEN + 1
ELSE + 0;
END
TABLE FILE FDI002
SUM 
     'CNT.FDI002.FDI002.FDI002_CHECK_NO' AS 'Received'
     'FDI002.FDI002.ckrelday1' AS 'Checks Released ,Day 1'
     'FDI002.FDI002.ckrelday2' AS 'Checks Released,Day 2'
     'FDI002.FDI002.ckrelgt2day' AS 'Checks Released,> 2 Days'
BY 'FDI002.FDI002.MonthYear' AS 'Month Year'
HEADING
"Check Log (Endorse)"
FOOTING
""
WHERE ( FDI002.FDI002.FDI002_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( FDI002.FDI002.FDI002_CHECK_STATUS EQ 'E' ) AND ( FDI002.FDI002.YYMDdateofdispo GE '2010/01/01' ) AND ( FDI002.FDI002.YYMDdateofdispo LE '2010/09/30' );
ON TABLE COLUMN-TOTAL AS 'YTD Totals'
ON TABLE PCHOLD FORMAT HTML
END
 JOIN
 FDI001.FDI001.FDI001_ACCT AND FDI001.FDI001.FDI001_LOAN_NO IN FDI001
 TO MULTIPLE FDI002.FDI002.FDI002_ACCT AND FDI002.FDI002.FDI002_LOAN_NO
 IN FDI002 TAG J0 AS J0
 END
DEFINE FILE FDI001
P9dtdeposit/P9=
IF J0.FDI002.FDI002_CHECK_STATUS EQ 'P'
THEN J0.FDI002.FDI002_CK_SENT_DT
ELSE J0.FDI002.FDI002_PROCESS_DT;
I8YYMDdtdeposit/I8YYMD=P9dtdeposit;
YYMDdtdeposit/YYMD=I8YYMDdtdeposit;
dtrpt/I8YYMD=FDI001.FDI001.FDI001_DT_REPORTED;
dtrpt2/YYMD=dtrpt;
ckrcvddt1/I8YYMD=J0.FDI002.FDI002_CK_RCVD_DT;
ckrcvddt2/YY|M|D=ckrcvddt1;
dtdepo/YY|M|D=I8YYMDdtdeposit;
dtout4/I4=DATEDIF(ckrcvddt2, dtdepo, 'D');
ckreldt1/I4=IF dtout4 LE 1 THEN + 1 ELSE + 0;
ckreldt2/I4=IF dtout4 EQ 2 THEN + 1 ELSE + 0;
ckreldt3/I4=IF dtout4 GT 2 THEN + 1 ELSE + 0;
MonthYear/MtrYY=I8YYMDdtdeposit;
END
TABLE FILE FDI001
SUM 
     'CNT.FDI001.FDI001.dtrpt2' AS 'Recieved'
     'J0.FDI002.ckreldt1' AS 'Checks Released ,Day 1 '
     'J0.FDI002.ckreldt2' AS 'Checks Released,Day 2'
     'J0.FDI002.ckreldt3' AS 'Checks Released,> 2'
BY 'J0.FDI002.MonthYear' AS 'Month Year'
HEADING
"Deposits Summary"
FOOTING
""
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( J0.FDI002.FDI002_CHECK_STATUS EQ 'D' ) AND ( J0.FDI002.YYMDdtdeposit GE '2010/01/01' ) AND ( J0.FDI002.YYMDdtdeposit LE '2010/09/30' ) AND ( FDI001.FDI001.FDI001_DT_REPORTED NE 0 ); 
ON TABLE COLUMN-TOTAL AS 'YTD Totals'
ON TABLE PCHOLD FORMAT HTML
END


This code displays:
 
Check Log (Endorse) 
Month Year       Received   Checks Released Day1
January,2010     14         12
Febuary,2010     10         2
...

Deposits Summary
Month Year       Received   Checks Released Day1
January,2010     12         1
Febuary,2010     20         5
...


From the data recieved from these reports I want to make another report that gets totals for received, checks released day1, etc.
Ex.

  
Month Year       Received   Checks Released Day1
January,2010     26         13
Febuary,2010     30         7
...



I was thinking of making hold files and going from there but I am not too sure how to do that. Any help will be appreciated.

This message has been edited. Last edited by: <d3nis370>,
 
Report This Post
Virtuoso
posted Hide Post
From the look of it the output seems to be of the same format. If this indeed is the case, and I mean exactly the same, you could indeed use hold for the first part and hold append for the second. This will put both sets of record into one and the same hold file and you can report off that file to produce your totals.
Example of this technique using the car file:
TABLE FILE CAR
PRINT CAR MODEL SEATS
BY COUNTRY
ON TABLE HOLD
END
FILEDEF HOLD DISK HOLD.FTM (APPEND
TABLE FILE CAR
PRINT CAR MODEL SEATS
BY COUNTRY
ON TABLE HOLD
END
TABLE FILE HOLD PRINT *
END

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
<d3nis370>
posted
Well I did the append and it looks like it didn't put the records into one hold file. Did I do something wrong?

 DEFINE FILE FDI002
P9dateofdispo/P9=
IF FDI002.FDI002.FDI002_CHECK_STATUS EQ 'P'
THEN FDI002.FDI002.FDI002_CK_SENT_DT
ELSE FDI002.FDI002.FDI002_PROCESS_DT;
I8YYMDdateofdispo/I8YYMD=P9dateofdispo;
YYMDdateofdispo/YYMD=I8YYMDdateofdispo;
MonthYear/MtrYY=I8YYMDdateofdispo;
daysoutstanding/P9=P9dateofdispo - FDI002.FDI002.FDI002_CK_RCVD_DT;
ckrelday1/P9=
IF daysoutstanding LE 1
THEN + 1
ELSE + 0;
ckrelday2/P9=
IF daysoutstanding EQ 2
THEN + 1
ELSE + 0;
ckrelgt2day/P9=
IF daysoutstanding GT 2
THEN + 1
ELSE + 0;
END
TABLE FILE FDI002
SUM 
     'CNT.FDI002.FDI002.FDI002_CHECK_NO' AS 'Received'
     'FDI002.FDI002.ckrelday1' AS 'Checks Released ,Day 1'
     'FDI002.FDI002.ckrelday2' AS 'Checks Released,Day 2'
     'FDI002.FDI002.ckrelgt2day' AS 'Checks Released,> 2 Days'
BY 'FDI002.FDI002.MonthYear' AS 'Month Year'
HEADING
"Check Log (Endorse)"
FOOTING
""
WHERE ( FDI002.FDI002.FDI002_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( FDI002.FDI002.FDI002_CHECK_STATUS EQ 'E' ) AND ( FDI002.FDI002.YYMDdateofdispo GE '2010/01/01' ) AND ( FDI002.FDI002.YYMDdateofdispo LE '2010/09/30' );
ON TABLE COLUMN-TOTAL AS 'YTD Totals'
ON TABLE HOLD FORMAT FOCUS
END

FILEDEF HOLD DISK HOLD.FTM (APPEND
 JOIN
 FDI001.FDI001.FDI001_ACCT AND FDI001.FDI001.FDI001_LOAN_NO IN FDI001
 TO MULTIPLE FDI002.FDI002.FDI002_ACCT AND FDI002.FDI002.FDI002_LOAN_NO
 IN FDI002 TAG J0 AS J0
 END
DEFINE FILE FDI001
P9dtdeposit/P9=
IF J0.FDI002.FDI002_CHECK_STATUS EQ 'P'
THEN J0.FDI002.FDI002_CK_SENT_DT
ELSE J0.FDI002.FDI002_PROCESS_DT;
I8YYMDdtdeposit/I8YYMD=P9dtdeposit;
YYMDdtdeposit/YYMD=I8YYMDdtdeposit;
dtrpt/I8YYMD=FDI001.FDI001.FDI001_DT_REPORTED;
dtrpt2/YYMD=dtrpt;
ckrcvddt1/I8YYMD=J0.FDI002.FDI002_CK_RCVD_DT;
ckrcvddt2/YY|M|D=ckrcvddt1;
dtdepo/YY|M|D=I8YYMDdtdeposit;
dtout4/I4=DATEDIF(ckrcvddt2, dtdepo, 'D');
ckreldt1/I4=IF dtout4 LE 1 THEN + 1 ELSE + 0;
ckreldt2/I4=IF dtout4 EQ 2 THEN + 1 ELSE + 0;
ckreldt3/I4=IF dtout4 GT 2 THEN + 1 ELSE + 0;
MonthYear/MtrYY=I8YYMDdtdeposit;
END
TABLE FILE FDI001
SUM 
     'CNT.FDI001.FDI001.dtrpt2' AS 'Recieved'
     'J0.FDI002.ckreldt1' AS 'Checks Released ,Day 1 '
     'J0.FDI002.ckreldt2' AS 'Checks Released,Day 2'
     'J0.FDI002.ckreldt3' AS 'Checks Released,> 2'
BY 'J0.FDI002.MonthYear' AS 'Month Year'
HEADING
"Deposits Summary"
FOOTING
""
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( J0.FDI002.FDI002_CHECK_STATUS EQ 'D' ) AND ( J0.FDI002.YYMDdtdeposit GE '2010/01/01' ) AND ( J0.FDI002.YYMDdtdeposit LE '2010/09/30' ) AND ( FDI001.FDI001.FDI001_DT_REPORTED NE 0 );
ON TABLE COLUMN-TOTAL AS 'YTD Totals'
ON TABLE HOLD FORMAT FOCUS 
END
 
Report This Post
Virtuoso
posted Hide Post
Yes, but you probably did not know that.
This FILEDEF thing is valid for hold formats that write to fixed files, not focus files.
So if you change your hold type to be alpha, it will work.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
<d3nis370>
posted
I just got finished reading that. Thank You VERY VERY much everything worked PERFECT!!!
 
Report This Post
<d3nis370>
posted
So as I was checking the numbers I realized that they are wrong. For the 1st report the only numbers correct is from the first column. the second report everything is correct. Is there some reason why this is happening?
 
Report This Post
Virtuoso
posted Hide Post
Only thing I cab think of is that the two table requests do not produce exactly the same formatted files after all. You can check that by issueing a TYPE HOLD.MAS after each table. So, something like this:
TABLE FILE ...
PRINT ...
END
TYPE HOLD.MAS
FILEDEF ...
TABLE FILE ...
PRINT ...
END
TYPE HOLD.MAS

And then you can check the resulting page to see if there are any differences in the master files. Don't bother with fieldnames, that's ok, but do worry about the usage and actual formats. They MUST be EXACTLY the same for this thing to work. Also the order of the fielda MUST be the same.

Good luck, I hope this is the cause.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
<d3nis370>
posted
Some where P4 and some where I4 I had forgotten to change them. Thanks for your help everything is working now.
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Getting a Totals report from 2 other reports

Copyright © 1996-2020 Information Builders