Jump to content

Dividing two sums returns zero


Somdutt Behura

Recommended Posts

I have a cross table with two columns being added for total and then divide the two numbers to get weighted average. None of thesums is zero. Yet when I divide one from the other as calculated columns it returns zero. Please see attached file to see the issue. Sum(Gas Revenue) = 117098504 and Sum(Gas Volume) = 45647628. Sum(Realized Gas Price) should be117098504/45647628= 2.56. But the calculated columns return zero. How to fix it I am getting back to Spotfire after a long time. May be missing something simple.
Link to comment
Share on other sites

As we are handling a massive data, I can present how the data is organized. The data is rowise and grouped by many columns but differed by one column that is Component Name and corresponding values. In the above example Component Names we are looking into are 'Gas Revenue' and 'Gas Volume' and so on. We sum these components by year and than cross tab the records (transposing the sums to columns). That's how the data appears in the attached image (Sum (Gas Revenue), followed by sum(Gas Volume), followed by Calculated Columns Sum (Gas Revenue)/sum(Gas Volume). The ratio turns out to be zero, which is strange. Does this help
Link to comment
Share on other sites

Thanks. I cannot recreate a file from a description. You could generate a sample with a much smaller size. The issue looks like it is in the data and in the way the cross table is defined, but it is not possible for me to generate a file based from your description. Maybe somebody else will be able to help you.

 

Please take a look at some guidelines that I hope are useful:

 

https://community.spotfire.com/wiki/quick-tips-asking-community-questions

 

Gaia

Link to comment
Share on other sites

Can you directly use custom expressionSum (Gas Revenue)/sum(Gas Volume) in cross table instead of calculated column. As we do not know whichdata values are present for calculated column.

You can check in data table what values are populated for calculated column. If throughout each year calculated column shows same value then try using First([calculated columns]) instead of sum.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...