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.
I have the following fields DATE LASTODOMREADING Thisodomreading 6/28/2002 535 666 6/30/2002 666 767
If I do a report where I just want the LastOdomreading from the beginning of the date range and the THISodomreading from the ending of the date range how can I do this?
So the data to be returned should be Date Range Lowest Odom HighestODOM 6/28 - 6/30 535 767
TABLE FILE ODOM PRINT LASTREADING THISREADING COMPUTE COUNTER/I5 = COUNTER + 1; BY RDATE ON TABLE HOLD AS ODOMETER END -RUN
-SET &NUMRECS = &LINES;
DEFINE FILE ODOMETER FIRSTDATE/MDYY = IF COUNTER EQ 1 THEN RDATE ELSE FIRSTDATE; LASTDATE/MDYY = IF COUNTER EQ &NUMRECS THEN RDATE ELSE FIRSTDATE; LASTREAD/I7 = IF COUNTER EQ 1 THEN LASTREADING ELSE 0; THISREAD/I7 = IF COUNTER EQ &NUMRECS THEN THISREADING ELSE 0; END
TABLE FILE ODOMETER PRINT FIRSTDATE LASTDATE LASTREAD THISREAD ON TABLE HOLD AS FINAL END
TABLE FILE FINAL SUM FIRSTDATE LASTDATE LASTREAD THISREAD END
In case it isn't clear: In that first step, ODOM is your source file and RDATE is your date field. It's a lot of steps, I know, but I can't think of a way to do it in fewer. If any of it is confusing, I would suggest taking the HOLD out of the first step to see the results, then putting it back and taking HOLD out of the second step.
dwf
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005
Thanks, I appreciate the help. I have decided it's just easier to do all of the work through views on the SQL server and then just use Webfocus to pull the results.
TABLE FILE xxx
PRINT
MIN.LASTODOMREADING
MAX.Thisodomreading
AND COMPUTE ROWCNT/I9 = IF DATE EQ LAST DATE THEN LAST ROWCNT + 1 ELSE 1; NOPRINT
BY DATE
WHERE TOTAL ROWCNT EQ 1;
END
Ginny, There is some information about the usage of FST. and LST. in the Interface Manual specific to your RDBMS. Basically it looks like it should work as advertised as long as the KEYS setting in the FOCUS Access File Descriptions for your SQL Server TABLES are set properly.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
An explanation of FST. and LST. with regard to relational databases, is in the FOCUS for S/390 Relational Data Adapter User's Manual Version 7.2 Try page 4-28 (involving KEYORDER), and page 7-12, where it discusses translating FST. and LST. to SQL MIN and MAX.
One frivolous note: M's solution will only work if the lowest odometer reading is associated with the lowest date, and the highest reading is associated with the highest date. However, since your data appears to be so organized, it ought to work, barring any mistakes in data entry.
dwf
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005