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.
Have started to venture into a area of creating more complex WebFocus reports than I'm accustomed to and need advice, suggestions on how I might proceed given the following requirements.
Have a simple database comprising of 3 fields Name char(64) Training_Start_Date MDYY Training_End_Date MDYY
Requirements.
Report that prints out a daily total of # of students in training for a selected period of time.
Report would prompt user to enter a Start and End date and would print out daily totals for that particular period
As Example. Reports Prompts: Start: 05/01/2009 End: 05/31/2009
Report
Date # Stds in Training 05/01/2009 24 05/02/2009 24 05/03/2009 58 . . . 05/31/2009 96
Would I be looking at using a "looping Function" of some kind? If so can you direct me to which commands/functions/logic I should study up on?
Thanks, JeffThis message has been edited. Last edited by: Jeff_Rowland,
You say that you are looking for a "looping function". You are thinking of creating a list of dates between the start and the end dates and then checking for each generated date if it falls between the training dates. If it does count the occurrence. If it doesn't, don't count.
The beauty of Focus is that you don't think "loop", you think "set".
In order to have a set of dates between the start and end, the best way is to use a McGuyver file. Here is a file and its master. The file (notice that the first character of this string is a blank!)
-* File Jeff.fex
-* Generate a HOLD file that mimics Jeff's 3 field file.
-*It has 2 dates, the first is within 100 days after 1 jan 2009; the second is within 30 days after.
DEFINE FILE CAR
ADATE/DMYY WITH MODEL='01/01/2009';
F_DATE/DMYY=ADATE + 100*RDUNIF('D6.5');
T_DATE/DMYY=F_DATE + 30*RDUNIF('D6.5');
END
TABLE FILE CAR
PRINT F_DATE T_DATE
BY MODEL
ON TABLE HOLD
END
-RUN
-* The 2 variables hold the start and end dates as the user would have entered them
-SET &F_DATE='01/02/2009';
-SET &T_DATE='28/02/2009';
-RUN
-* The McGuyver file is called FSEQ
-* The JOIN between the HOLD and the FSEQ files will generate the dates between start and end.
JOIN BLANK WITH MODEL IN HOLD TO BLANK IN FSEQ AS M_
DEFINE FILE HOLD
BLANK/A1 WITH MODEL=' ';
BDATE/DMYY='&F_DATE';
ZDATE/DMYY='&T_DATE';
RDATE/DMYY=BDATE + COUNTER - 1;
END
-* The report extracts all the records where the generated date is between the training dates
TABLE FILE HOLD
COUNT MODEL
BY RDATE
WHERE RDATE GE F_DATE
WHERE RDATE LE T_DATE
WHERE RDATE LE ZDATE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
TABLE FILE CASHFLOW
SUM
CNT.SHRT_TERM_DEBT
BY CASH_DATE
HEADING
""
FOOTING
""
WHERE ( CASH_DATE GE '&CASH_DATE1' ) AND ( CASH_DATE LE '&CASH_DATE2' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
WF 7.6.11 Oracle WebSphere Windows NT-5.2 x86 32bit
That would work great if there is an entry for each date, but from the explanation, I don't think there is - it's just a date range and you have to determine if the course date falls within that range.
Since the dates are &variables, you could create a loop like the following to define each day and then see if your a course falls on that day. Here's an example from the TRAINING file:
-SET &ECHO=ALL;
-SET &BEGDATE='19910601';
-SET &ENDDATE='19910612';
-SET &NUMDAYS=DATEDIF(&BEGDATE,&ENDDATE,'D');
-TYPE &NUMDAYS
-SET &DAY=0;
DEFINE FILE TRAINING
COURSEEND/MDYY=COURSESTART+10;
BEGDATE/YYMD=&BEGDATE;
-REPEAT THISLOOP &NUMDAYS TIMES
DAY&DAY/YYMD=DATEADD('&BEGDATE','D',&DAY);
DAYCNT&DAY/I9=IF DAY&DAY GE COURSESTART AND DAY&DAY LE COURSEEND THEN 1 ELSE 0;
-SET &DAY=&DAY+1;
-THISLOOP
END
TABLE FILE TRAINING
SUM
-SET &DAY=0;
-REPEAT PRINTLOOP &NUMDAYS TIMES
DAYCNT&DAY.EVAL AS 'DAY&DAY'
-SET &DAY=&DAY+1;
-PRINTLOOP
END
You'll probably have to print * from the training file to see that corresponding data
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007