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'm trying to get numbers into Excel in such a way that if someone sums them in the spreadsheet they arrive at the same (sub-)totals as WebFOCUS did when generating the sheet. So far the numbers tend to be off by a few...
If you SUM(A1:A9) you arrive at 38 306! One higher than what WebFOCUS came up with. The difference is due to some decimal numbers that we don't want printed in the Excel sheet...
But I have to do this for quite a few fields and I need to be really careful about which fields I round this way and which I don't. I can't imagine there's no more convenient method.
Unfortunatly, Excel templates are out of the question, as we're stuck with Excel 2000. I also can't use EXL2K FORMULA on this report, as the borders break the cel references as per one of my other posts (and a bug report).This message has been edited. Last edited by: Wep5622,
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
This is a very annoying problem with WebFOCUS. I haven't found a solution. One workaround I've used is to add or subtract .1 from one of the lines. This means you have to do a pile of processing just to find out if the rounding caused a problem with the SUM.
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
Oh dear, and here I thought I was asking a simple question...
Thankfully my requirements aren't as strict as Francis', I'd be quite happy to find out the secret method for how to calculate numbers in one precision but display them in another in Excel, if such a thing exists.
It is obvious to me that WebFOCUS does something to massage the data into the formatting required for the end result, having some control over whether it rounds or formats the data would be great! For example, I'd like to be able to specify 'TYPE=DATA, FORMAT=D5.2S,$' in my style sheet for a field that actually has precision D5.10. This would just set the column format in Excel to '## ##0,00', but keep the actual precision. That way my numbers add up properly, while they are displayed in a sane way to the end users.
Of course they wouldn't add up again if displayed with their actual precision (formatted in Excel like '# ##0,0000000000'), as the thread Francis references makes all too clear - that's what you get with finite precision numbers. That's exactly why being able to manipulate the format in which those numbers are displayed is necessary.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
The way I got around this is to use P format with as many decimal positions as allowed. For example, if a field will never be more than 99999, use P17.11. Note, P format by default does not use commas like D format. Output those numbers to excel and have a auto-open macro in excel to change the format to 2 decimal positions. The full number is still there, but displaying rounded to 2 decimal positions. If someone else copies the data to another spreadsheet, they will copy the full precision. So if they sum the numbers again, they will get the same answer. As long as they don't change the data by using the excel function to round or truncate the numbers, everything should be fine, and if they do, then tell them the numbers don't add up because they changed the data.
This is what I did when I had to match some federal measures that went to 12 decimal positions.
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
Wow thanks, using PACKED instead of DECIMAL worked! We couldn't quite figure out what you intended to do with that macro, but we don't seem to need it anyway...
But that raises the question why summing rounded PACKED numbers works "better" than summing rounded DECIMALs? This seems quite alarming, so we'd like to understand this better. Could you (or someone else) elaborate please?
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
The details of rounding are handled in the following ways for the following numeric formats:
Integer format. When a value with decimal places is assigned to an integer field, the value is rounded before it is stored. If the value is assigned using a DEFINE or COMPUTE command, the decimal portion of the value is truncated before it is stored. Packed-decimal format. When a value is assigned to a packed-decimal field, and the value has more decimal places than the field format specifies, the value is rounded before it is stored.
Floating-point single- and double-precision formats. When a value is assigned to one of these fields, and the value has more decimal places than the field format specifies, the full value is stored in the field (up to the limit of precision determined by the field internal storage type). When this value is later displayed, however, it is rounded.
Note that if the decimal portion of a floating-point value as it is internally represented in hexadecimal floating-point notation is repeating (that is, non-terminating), the repeating hexadecimal number is resolved as a non-repeating slightly lower number, and this lower number is stored as the field value. In these situations, if in the original value of the digit to be rounded had been a five (which would be rounded up), in the stored lower value it would become a four (which is rounded down).
Thanks for the explanation, we were under the (wrong) impression that decimals were equivalent to SQL's fixed point numeric type.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :