Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

1 Solution

Accepted Solutions
Highlighted
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
Highlighted
MVP
MVP

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

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

Highlighted
Contributor II
Contributor II

Hi 🙂

 

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

Highlighted
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

Highlighted
Contributor II
Contributor II

Thanks Master! 🙂