
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set and sum, nested aggregation not allowed
Hi I want to divide two formulas in one expression, seperately they work fine:
1. =Sum({<field1={'1'}>} field2)
2. =Sum({<field1={'1'}>} field2) - Sum({<field1={'1'}, field3={'-1'}>} field2)
But If try a version with (2.)/(1.) it does not work. If I try that i get 'nested aggregation not allowed' if I add serveral sum functions. Further more I tried to put them in two variables and then divide the variables, but then I get a wrong number. Do I need if and aggr instead?
- Tags:
- new_to_qlikview
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try adding parentheses before each formula so that it will be
( Sum({<field1={'1'}>} field2) - Sum({<field1={'1'}, field3={'-1'}>} field2) )
/
(Sum({<field1={'1'}>} field2))
also what is the chart type that you are using?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try adding parentheses before each formula so that it will be
( Sum({<field1={'1'}>} field2) - Sum({<field1={'1'}, field3={'-1'}>} field2) )
/
(Sum({<field1={'1'}>} field2))
also what is the chart type that you are using?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what is the mistake it returns when you do
(Sum({<field1={'1'}>} field2) - Sum({<field1={'1'}, field3={'-1'}>} field2))
/
(Sum({<field1={'1'}>} field2))
let me know

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, so I just needed the parentheses at start, I was trying sum(sum(
BTW I seems like that I only need the extra parentheses in the long formula, because I substract two sum's and must capture that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well Malek was first but thank you.
