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.
We are building a data warehouse calendar month dimension table and I want a month column in YYM format based on an integer field in the database table. This works fine with YYMD formats but seems to have a bug with YYM formats (or is it I just don't understand something here?). For the most part the returned ccyy/mm values look good .. but not always. Here is example output and build code:
That is a possibility .. since the grain of the dimension table needs to be month rather than day we would have to take the integer associated with the first day of each month and store that. Pesky thing!
In the mean time I've relented and reverted to using I6YYM as the USAGE with ACTUAL=I4. Takes me back 20 years! But I might try your suggestion since smart dates are so much better.
Thanks for the help.
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007
One problem with the DEFINE field workaround is that SQL aggregation no longer works.
Can anyone else confirm whether they use Calendar Month dimension tables and have encountered this problem on smart dates? The timescale of my project deliverables does not allow waiting for IB to fix this (if its a bug) but if its just me then maybe I misunderstand something. Otherwise I need to log it for the greater good .. just want to check before I take it further.
Thanks All
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007
Roy, can you store your SQL date column with a date or date-time format? Then there wouldn't be any problems with the translation to a WebFOCUS date or with SQL aggregation.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Tony, thanks for that. 36525 does indeed get transformed to 1999/12/31 when formatted as a date yyyy/mm/dd. 1286 gets transformed to 1903/07 when formatted as yyyy/mm, which is the behaviour that Roy D mentions, so, if Excel does it this way it must be the right way.
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
Well, it seems that an integer is an integer when "used" as such (USAGE). However, when using a different data type (date-based for instance) WebFOCUS has a way to interpret it:
USAGE=YYMD, ACTUAL=I4
The number is treated as a DATE and it's interpreted as the number of days since Dec. 31, 1900.
USAGE=YYM, ACTUAL=I4
Here the field is calculated as the number of months since Dec.31, 1900.
I could not find the documentation piece that explain how a date is calculated as an offset based on Dec.31, 1900 (well, I'm probably not searching hard enough) but I'll keep trying.
By the way, I tried USAGE=YY thinking that it may probably be interpreted as a number of years since Dec. 31, 1900 but it actually returned the same integer value.
SmartDate fields are actually stored as an elapsed interval relative to the base-date of December 31, 1900. As a result January 1, 1901 has a stored value of 1. Dates with values before this reference date count in a negative direction and dates after this reference date count in a positive direction.
When we started building the dimension tables for our star-schemas we began, as is pretty standard, with a day-level calendar dimension. Typically I use the internal number rendered as a smart-date (YYMD etc) by WebFOCUS as the surrogate key as well. This is just a convenience. But I use the same type of number for date columns in the table since it is very direct .. WebFOCUS just needs a USAGE=YYMD on an ACTUAL=I4. As noted by others that means a 4 byte integer field gets stored and the integer is the offset in days from 31 Dec 1900. (Waz put the sort of code we would use to seed the table above in this track).
If you take the following code you'll see that just as day level dates convert to an integer (the afore-mentioned offset) so do months:
This result leads one to think that you can also use an integer with USAGE=YYM on top to represent a month. And this works .. but not always. My question is why not? To be fair to IB I don't think it is documented. But the integers loaded into SQL Server (above) came from WebFOCUS using something like this code snippet. And within the confines of a program they get respected. It is just that if you put them in a database and then try to read them back again they don't get respected.
When I have a moment I'll try the ACTUAL=DATE suggestion.
Thanks again for your thoughts. Roy
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007