dbTalk Databases Forums  

SSIS Derived Column rounding Errors

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS Derived Column rounding Errors in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SQLIdiot
 
Posts: n/a

Default SSIS Derived Column rounding Errors - 09-20-2006 , 09:12 AM






I am using a derived column to calculate values for exploded sales
estimates. The formula is pretty simple (Estimate *
(sales/Summedsales)). Each of these numbers are decimal(12, 4). The
problem is that the derived column values are not the same if I just
did the math. An example (149947.4395 * (2054.80/16225.87)) =
18988.9355. The derived column returns 18983.3458. Roughly a $5
difference. I have tried a few different expressions in the derived
column task but the results never seem to be accurate. I wanted to see
if anyone else has run into a similar issue and how they may have
resolved this. Thanks.


Reply With Quote
  #2  
Old   
Roy Harvey
 
Posts: n/a

Default Re: SSIS Derived Column rounding Errors - 09-20-2006 , 10:59 AM






I tried to replicate the problem using SQL Server 2000 SP3, but I
could not.

create table TT
( Estimate decimal (12,4),
Sales decimal (12,4),
Summedsales decimal (12,4),
Derived AS (Estimate * (sales/Summedsales)))

INSERT TT (Estimate, Sales, Summedsales)
VALUES (149947.4395, 2054.80, 16225.87)

select * from TT

Estimate Sales Summedsales Derived
-------------- -------------- -------------- -------------------------
149947.4395 2054.8000 16225.8700 18988.93548910474376352

Perhaps you can create such an example that demonstrates the problem?

Roy Harvey
Beacon Falls, CT

On 20 Sep 2006 07:12:09 -0700, "SQLIdiot" <matt.karriker (AT) irwin (DOT) com>
wrote:

Quote:
I am using a derived column to calculate values for exploded sales
estimates. The formula is pretty simple (Estimate *
(sales/Summedsales)). Each of these numbers are decimal(12, 4). The
problem is that the derived column values are not the same if I just
did the math. An example (149947.4395 * (2054.80/16225.87)) =
18988.9355. The derived column returns 18983.3458. Roughly a $5
difference. I have tried a few different expressions in the derived
column task but the results never seem to be accurate. I wanted to see
if anyone else has run into a similar issue and how they may have
resolved this. Thanks.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.