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.
DTDIFF does not return the same values as HTDIFF when endDate < startDate. HTDIFF returns the expected values.
In the following fex file and resulting report the "Age in Weeks" should be 0 from 10/17 through 10/23, -1 from 10/24 through 10/30, -2 from 10/31 through 11/06, -3 from 11/07 through 11/13, -4 from 11/14 through 11/20, and -5 from 11/21 through 11/27.
-* AGEINDAYSDEFINE DTDIFF( TODAYTIMESTAMP, DTE, DAY ) -* AGEINWEEKSDEFINE DTDIFF( TODAYTIMESTAMP, DTE, WEEK ) TABLE FILE T1 SUM T1.T1.AGEINDAYSDEFINE T1.T1.AGEINWEEKSDEFINE BY T1.T1.DTE WHERE ( T1.T1.DTE GE DT(2015-09-01) ) AND ( T1.T1.DTE LE DT(2015-11-30) ); ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT PDF ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ ENDSTYLE END
make it a habit to always enclose your code within
[code]
your code here
[/code]
tags. You can click on the </> button to generate the code tags.
Neither of the two functions you mention are WebFOCUS functions. There are DATEDIF and HDIFF, the syntax for each:
DATEDIF: Finding the Difference Between Two Dates
DATEDIF(from_date, to_date, 'component')
HDIFF: Finding the Number of Units Between Two Date-Time Values
HDIFF(end_dt, start_dt, 'component', output)
Do you see that in one the From Date is specified first and in the other it is specified second?
On FocalPoint is it also a good idea to post code that we can run - it makes it much easier for us to debug posted code. You can create re-runnable code by referencing one of the IBI-provided sample tables. Unfortunately, the readily available sample tables (e.g. CAR) are antiques that either don't have date columns or have data in date columns that are not easily usable.
Fortunately, there is an option to generate slightly more modern RDBMS tables: navigate to the appropriate WebFOCUS Reporting Server; click on the Applications tab; right-click on an application folder (e.g. ibisamp_; select New, then select Samples. A "Create Sample Procedures and Data" page is displayed, from where you can select "WebFOCUS - Retail Demo" or "WebFOCUS Star Schema with Variable Data" to create metadata and data... Check first - this might have already been done.
Meanwhile, GGORDER is a table that contains dates [2 digit year , something I don't trust]:
DEFINE FILE GGORDER
TODAYTIMESTAMP/YYMD = '1996/05/01';
ORDER_DATE_YYMD/YYMD = ORDER_DATE;
AGEINDAYS/P8 = DATEDIF(TODAYTIMESTAMP, ORDER_DATE_YYMD, 'DAY')
END
TABLE FILE GGORDER
SUM
MIN.TODAYTIMESTAMP
MIN.ORDER_DATE_YYMD
MIN.AGEINDAYS
BY ORDER_DATE_YYMD NOPRINT
END
You should be able to run this - for which dates are the results incorrect?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server