Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum / Aggregate not working as expected (chart vs. table)

Hi,

I'm having trouble figuring out why the sum (based on an aggregation) does not work... Well, it seems to return the first encountered value instead of summing up the values.

The screenshot below should explain better:

SumAggrIssue.png

When using the table object, you can see that for product 'rapc translator' is requested twice. When making the sum of both you would expect to see as list price 17600 (8800 + 8800) and as fixed price 8800 (0 + 8800).

This is the expression I'm using:

- List price: sum(aggr([Product License List Price],[Product Name]))

- Fixed price: sum(aggr([Product License Fixed Price],[Product Name]))

FYI, Just peforming a sum gives me a way to high figure... performing a max or min returns either the last or the first figure (0 or 8800) so the data can be retrieved but the sum ain't working.

Any help is higly appreciated.

Kind regards,

Maarten

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

sum(aggr( sum([Product License List Price]),[Product Name]))

sum(aggr( sum([Product License Fixed Price]),[Product Name]))

View solution in original post

4 Replies
swuehl
MVP
MVP

Try

sum(aggr( sum([Product License List Price]),[Product Name]))

sum(aggr( sum([Product License Fixed Price]),[Product Name]))

Not applicable
Author

Hi swuehl,

Thanks for your quick reply!

When I do that, I get the same results as when I perform a full sum (e.g. sum([Product License List Price])). Something must go wrong with the aggregation as it takes it as a single sum.

Regards,

Maarten

swuehl
MVP
MVP

Can you describe your data model a bit more detailed? Or, even better, post a small sample app that demonstrate your issue?

Not applicable
Author

Dear Swuehl,

When performing the reload (with minimal data) to able to post it to the forum and saving it to another file, all figures became correct. I suppose I made some changes to the script itself which were not yet taken into account and became activated during the reload? ...

Very strange but totally my bad I would say.

Your first answer was defintately correct!

Thanks a ton!!!

Regards,

Maarten