Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregates sum returns 0 when column contains positive and negative numbers #99

Closed
TenYearsGone opened this issue Dec 4, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@TenYearsGone
Copy link

Python version 2.7.9
CubesViewer 2.0

I have a postgresql view column that contains both positive and negative (double precision) numbers. When using aggregates sum in model.json the cubes viewer view returns only 0s (albeit with sometimes a negative sign). When I modify the database view and put ABS over the column, the cubes viewer sums correctly (although the values are incorrect). Is this a bug? in CubesViewer or Cubes?

@jjmontesl
Copy link
Owner

jjmontesl commented Dec 5, 2018

Can you post an excerpt of the resulting JSON?

(Use the browser inspect tools to inspect the "network" requests, and check the result of the query that brings the data. The resulting JSON contains the raw data which we can check to see if this is on Cubes or CubesViewer side).

@TenYearsGone
Copy link
Author

{
"summary": {
"netamount_sum": -4.27825774806934e-10
},
"remainder": {},
"cells": [],
"aggregates": [
"netamount_sum"
],
"cell": [],
"attributes": [],
"has_split": false
}
Looks like CubesViewer isn't rendering it possibly because it's too small. The returned sum is correct according to the data in the database. We noticed that the currency data values in the database (which was migrated from SQL) are floats. Once we applied rounding the problem was addressed, I think.

@jjmontesl jjmontesl self-assigned this Dec 23, 2018
@jjmontesl jjmontesl added this to the 2.0.x milestone Dec 23, 2018
@jjmontesl
Copy link
Owner

Thank you for the feedback. I'm closing this as not a bug then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants