Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Calculated column expression - 180 / 200 is 0, 180 / 200.0 = 0.9

$
0
0

Hi,

 

I have created a calculated column with the following formula, it was always returning 1 (always 0 + 1):

 

(("X" - A) / (B - 1)) * (C - D) + 1

 

 

Example

 

(("X" - 1) / (3000 - 1)) * (100 - 1) + 1

 

 

I believe I can boil down the issue.  The result of the following calculated column expression, data type decimal(5,2) in red:

 

180 / 200 =0

 

 

 

However following calculated column expression and result is correct:

 

 

180 / 200.0 = 0.9

 

 

 

Can anyone explain this please?  If so how I might rewrite the first expression using X=200 as an example (result should be 6.6).

 

Many thanks.


Viewing all articles
Browse latest Browse all 8581

Trending Articles