3 Replies Latest reply on Jan 13, 2014 12:11 PM by Peter Gilks

# ABS Function - Absolute is not calculating the absolute value.

Absolute function is not calculating the absolute value.

I have attached a table, has 2 columns - ScenarioName and Cost. My objective is to calculate the difference between any 2 scenarios selected and then to find the absolute of the difference.

When I select A(Cost = 1) and B (Cost = 2) then I want the difference as -1 and absolute difference as 1.

Can someone help me figure out what I am doing wrong or how to make it behave it like I want to.

• ###### 1. Re: ABS Function - Absolute is not calculating the absolute value.

Your cost difference calculation doesn't really make sense , since a row is either A or B you cant calculate the difference using a row calculated field. You need to aggregate before calculating the difference.

You should replace

zn([CostA])-zn([CostB])

with

SUM( [CostA] ) - SUM( [CostB] )

After that   ABS([costDiff]) will work as expected

Michel

• ###### 2. Re: ABS Function - Absolute is not calculating the absolute value.

Michel

Regards

Karthik

1 of 1 people found this helpful
• ###### 3. Re: ABS Function - Absolute is not calculating the absolute value.

Hi Karthik,

When you look at the underlying data you can see that ABS is working, but it works at the row level.