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've got a fairly standard date calculation set up in a master file, since I use it in a few different places. It's defined as such: DATEDIF(HDATE( field_name,'YYMD'),&YYMD,'D')
It works excellently as defined in the master file.
However, if the exact same formula is used as a compute or define in a fex, the fex-used code comes up with a bad result. Example, 20 million (or so) instead of 6000 (or so). I can't seem to find any correlation between the two numbers, or any reason why the same calculation should work differently. Has anyone got any experience with something like this?This message has been edited. Last edited by: Keith MacDonald,
WebFOCUS & DataMigrator 7.7.03M Windows 2003, Windows 2008 x64
Is it possible that the calculated number of days is an aggregated value and that's why you're getting 20 million instead of 6000? I.E. there are multiple input rows with the same date...
If there are joins, is the same column name in another table in the joined structure?
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
Look at the Help page (in Dev Studio) for DATEDIF, including the examples provided. If either date argument of DATEDDIF() is a constant, it must be put in quotes.
If you omit the quotes, and code DIFF/I9=DATEDIF( HDATE(my_datetime_field,'YYMD'), &YYMD,'D'); in a fex, the line placed in focstack and executed (today) is DIFF/I9=DATEDIF( HDATE(my_datetime_field,'YYMD'), 20110713,'D');
Since DEFINE knows that a ("smart") date field is expected, and such fields internally hold integer offsets from a base date around 1900, 20110713 is interpreted as the date 20,110,713 days beyond the base date. Need I say more?
With quotes: DIFF/I9=DATEDIF( HDATE(my_datetime_field,'YYMD'), '&YYMD','D'); -- the line resolves to DIFF/I9=DATEDIF( HDATE(my_datetime_field,'YYMD'), '20110713','D'); The quoted numeric string '20110713' is understood, in this context. as representing the date 2011-07-13, and the offset of that date is used.
For a define in the mfd, different logic takes hold (the &YYMD there never gets subject to the substitution & stacking process of lines in a fex). &YYMD gets replaced by a proper date variable initialized to the current date, and all is well. But in a fex you must supply the quotes.This message has been edited. Last edited by: j.gross,
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005