Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Kseniya1313
Contributor II
Contributor II

Nested aggregations with SUM and IF function

Dear all,

Some help needed: 

I want to create grouping for the clients which turnover is higher than 10000 €, between 10000 € and 20000 € and etc.

When i type the formula:

=if(sum([SMT.ResultAmount]>0 and sum([SMT.ResultAmount]<10000), 'Group 1'))

I get the notification that Nested aggregations are not allowed.

Can you please please please help? 🙂

Thanks,

Kseniya

Labels (1)
1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

If you are using this in a dimension, you need an aggregation function

=aggr(if(sum([SMT.ResultAmount])>200 and sum(SMT.ResultAmount)<300,'Group 1'), ClientID)

ClientID would be your client field; remember also to deselect "Include null values"

View solution in original post

4 Replies
tresesco
MVP
MVP

It's possibly because of improper brackets. Try like:

=if(sum([SMT.ResultAmount])>0 and sum([SMT.ResultAmount])<10000, 'Group 1')

Kseniya1313
Contributor II
Contributor II
Author

Hi 🙂

 

Thanks for your reply. tried that version already as well. Get the Invalid dimension from when i close the formula window 😞

lorenzoconforti
Specialist II
Specialist II

If you are using this in a dimension, you need an aggregation function

=aggr(if(sum([SMT.ResultAmount])>200 and sum(SMT.ResultAmount)<300,'Group 1'), ClientID)

ClientID would be your client field; remember also to deselect "Include null values"

Kseniya1313
Contributor II
Contributor II
Author

Thanks Master! 🙂