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] 3 reports into 1 with different criteria

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] 3 reports into 1 with different criteria
 Login/Join
 
<d3nis370>
posted
I made 3 reports all reporting off of the same table with different criteria. I want to combined the reports to only print 1 report with all the data. Here is my code.

TABLE FILE FDI001
SUM 
     'CNT.FDI001.FDI001.FDI001_DT_REPORTED' AS 'NEW'
BY 'FDI001.FDI001.FDI001_ACCT'
BY 'FDI001.FDI001.MonthYear2'
HEADING
""
FOOTING
""
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( FDI001.FDI001.dtrpt2 GE '2010/01/01' ) AND ( FDI001.FDI001.dtrpt2 LE '2010/10/31' );


TABLE FILE FDI001
SUM 
     'CNT.FDI001.FDI001.FDI001_DT_REPORTED' AS 'CLOSED'
BY 'FDI001.FDI001.FDI001_ACCT'
BY 'FDI001.FDI001.MonthYear3'
HEADING
""
FOOTING
""
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( FDI001.FDI001.closedt2 GE '2010/01/01' ) AND ( FDI001.FDI001.closedt2 LE '2010/10/31' );


TABLE FILE FDI001
SUM 
     'CNT.FDI001.FDI001.FDI001_DT_REPORTED' AS 'OPEN'
BY 'FDI001.FDI001.MonthYear2'
BY 'FDI001.FDI001.FDI001_ACCT'
HEADING
""
FOOTING
""
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( FDI001.FDI001.FDI001_DEPOSIT_AMT_BAL EQ 0 ) AND ( FDI001.FDI001.FDI001_CLOSE_DT EQ 0 ) AND ( FDI001.FDI001.dtrpt2 GE '2010/01/01' ) AND ( FDI001.FDI001.dtrpt2 LE '2010/10/31' );


I want the output to look like this.
Month Year    NEW    CLOSED    OPEN
January,2010  10     5         2
Febuary,2010  25     7         40


I was going to make the reports hold files and go from there but because the closed report is reporting on a differrent date the data for the closed column is all wrong. I am not sure how to fix this. Any help is appreciated.

This message has been edited. Last edited by: <d3nis370>,
 
Report This Post
Virtuoso
posted Hide Post
quote:
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) AND ( FDI001.FDI001.dtrpt2 GE '2010/01/01' ) AND ( FDI001.FDI001.dtrpt2 LE '2010/10/31' );

I would try to create a define for each of the where's in the 3 requests. The first could possibly read something like:
NEW/I4 = IF (FDI001_ACCT EQ 7125 OR 7126 OR 7127) AND (dtrpt2 GE '2010/01/01') AND (dtrpt2 LE '2010/10/31') THEN 1 ELSE 0;
And then it is just a question of SUM-ming the defined fields by the sort fields. I did also notice that one of the sort orders is different from the other two. That is hopefully not intentional, if it is you can't use this method because you can't have two different sort orders in one request.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
Use Match File

MATCH FILE FDI001
SUM
     'CNT.FDI001.FDI001.FDI001_DT_REPORTED' AS 'NEW'
BY 'FDI001.FDI001.FDI001_ACCT'
BY 'FDI001.FDI001.MonthYear2'  AS monthyear
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) 
AND ( FDI001.FDI001.dtrpt2 GE '2010/01/01' ) 
AND ( FDI001.FDI001.dtrpt2 LE '2010/10/31' );
RUN

FILE FDI001
SUM
     'CNT.FDI001.FDI001.FDI001_DT_REPORTED' AS 'CLOSED'
BY 'FDI001.FDI001.FDI001_ACCT'
BY 'FDI001.FDI001.MonthYear3'  AS monthyear
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) 
AND ( FDI001.FDI001.closedt2 GE '2010/01/01' ) 
AND ( FDI001.FDI001.closedt2 LE '2010/10/31' );
AFTER MATCH HOLD OLD-OR-NEW
RUN

FILE FDI001
SUM
     'CNT.FDI001.FDI001.FDI001_DT_REPORTED' AS 'OPEN'
BY 'FDI001.FDI001.FDI001_ACCT'
BY 'FDI001.FDI001.MonthYear2'  AS monthyear
WHERE ( FDI001.FDI001.FDI001_ACCT EQ 7125 OR 7126 OR 7127 ) 
AND ( FDI001.FDI001.FDI001_DEPOSIT_AMT_BAL EQ 0 ) 
AND ( FDI001.FDI001.FDI001_CLOSE_DT EQ 0 ) 
AND ( FDI001.FDI001.dtrpt2 GE '2010/01/01' ) 
AND ( FDI001.FDI001.dtrpt2 LE '2010/10/31' );
AFTER MATCH HOLD OLD-OR-NEW
END

(note that you have to put the BY fields in corresponding order, and give them matching column-names.)
That should give you a hold file with the required rows and columns.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
Ah, yes, overlooked that the sorts are all different. But as long as the sortorder is the same, you could also try to do it with a define. Something like SORTFIELD/MYY = IF NEW EQ 1 'CLOSED' THEN MonthYear3 ELSE MonthYear2; and then sort by SORTFIELD. Might also 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
GamP the data for New and Open is correct but for closed its still wrong.

j.gross I got an error saying unrecognized (and it prints the code). I am guessing it isn't recognizing the match.
 
Report This Post
<d3nis370>
posted
quote:
SORTFIELD/MYY = IF NEW EQ 1 'CLOSED' THEN MonthYear3 ELSE MonthYear2;


why is 'CLOSED' in the define?
 
Report This Post
<d3nis370>
posted
well i figured out what was wrong with my match and it worked perfect! Thanks for everyones help!!!
 
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] 3 reports into 1 with different criteria

Copyright © 1996-2020 Information Builders