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 two tables with the same data one in WebFOCUS and the other in SQL Server. In WebFOCUS the numeric field is defined as D19.2 and in SQl Server it is defined as money(to maintain the precision) and redefined as D19.2 in the master file.
Here's the issue, As we know even though the field is defined as a D19.2 the values are stored at a higher precision in the database. WebFOCUS is rounding the values differently depending on the where the data is coming from
an example,
Value in SQl Server: 39.425 Value in WebFOCUS Datamart: 39.425
Displayed using a print statement from SQL Server : 39.43 from WebFOCUS : 39.42
this is an issue only when there is a 5 at the end.
is there any setting I can change to get consistent results?
Thanks in AdvanceThis message has been edited. Last edited by: <Kathryn Henning>,
Release: Webfocus 7.6.11 OS/Platform: Windows Output: HTML, EXL2K
For MONEY, I don't think that using D (Floating Point) field is recommended. Using a P (Packed) field would be the normal approach for both the SQL data source of MONEY, and the WebFOCUS datamart itself.
That should stop any rounding issues.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Using the P(Packed) format didn't help either.. WebFOCUS is rounding differently depending on the underlying datasource.. did any one experience similar issue while comparing data from different sources.
Release: Webfocus 7.6.11 OS/Platform: Windows Output: HTML, EXL2K
to give a little background we are trying to move the data to SQL sever and maintin the same results. Which means leave the precision for calculations(use 39.425) but rounded off(Use 39.42) when displaying the output.
Thanks,
Release: Webfocus 7.6.11 OS/Platform: Windows Output: HTML, EXL2K
I'll go one better, make the ACTUAL=D8. We use Oracle and all of our money fields are USAGE=D10.2 and ACTUAL=D8. We've never had an issue with rounding.
The ACTUAL is the internal format, i.e. double word binary for D8. There is no interal precision for D or F format fields. If I have a field defined as USAGE=D10.2 and ACTUAL=D8, if I compute 1/3, the field will contain .3333... but will display .33. Likewise, 10/3 will contain 3.3333... and display 3.33. D and F fields do no rounding, they truncate results. On the other hand P fields maintain internal precision and round. Try it out.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006
Starting with the basics,a WebFOCUS data file, SUFFIX = FOC, does not require an ACTUAL and USAGE. The ACTUAL is determined by the USAGE, or FORMAT. So a D19.2 will always have an ACTUAL of D8.
which is exactly as I would expect for standard rounding.
So why is the value seen on this post rounding to .42 instead of .43? If a calculation is done on a D field, the results may not always be exactly as expected. So within the WebFOCUS data file, the field money is multiplied by 9.43968467 and stored. Then divided by 9.43968467 and stored.
So the maths has changed the actual held value subtly. The D & F fields will behave in this way, it is floating point arithmetic and more decimal places are actually held than are required by the FORMAT. A D or F format can be changed in the MFD to more decimal places or less without needing to reload the data.
However, if the WebFOCUS table is built with a FORMAT of P19.2, the actual decimal places are as declared, so the same calculation done on a P19.2 results in.
So this is now different, and it is the way that the data is held. Also a P field cannot have the number of decimal places changed without reloading the data. But if the data is reloaded with P19.4 and reported as P19.2 the results are the same and round as expected.
We use Oracle and all of our money fields are USAGE=D10.2 and ACTUAL=D8. We've never had an issue with rounding.
As I mentioned The SQl Server data is rounding correctly but the WebFOCUS rounding was inconsistent. We were trying to figure out why and replicate the error if possible(the checkout program was creating a lot of noise because of this).
Alan B's post clearly explains the difference.. The differences are because of the way we load the data.. Thank you.. Truly a Virtuoso.
Release: Webfocus 7.6.11 OS/Platform: Windows Output: HTML, EXL2K