Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested Aggregation Not allowed?

HI,

This is the formula I want to use in a pivot table.

count(    if(

(Status_Incidents='Closed' or Status_Incidents='Resolved'

or (Status_Incidents='Waiting' and [Assignment Status]<>'Completed')),Status_Incidents,

if((if((count(if([Assignment Status]<>'Forwarded', [Incident #])))=0,'Forwarded',

if((count(if(([Assignment Status]='Waiting' or [Assignment Status]='Accepted'), [Incident #])))=0,'Completed',

if((count(if([Assignment Status]='Accepted', [Incident #])))>0,'Accepted','Waiting')

)

))='Completed', InCompleted',Status_Incidents)

))

It is showing the error "Nested Aggregation Not allowed".

I dont think if I can use Aggr because of the conditions used.

Can anyone help me on this?

11 Replies
sunny_talwar

I think you are doing Count(if(Count(.... which is not possible without an Aggr() function... Why do you think that you cannot use Aggr() here? Can you may be share a sample for us to help you better?

oknotsen
Master III
Master III

I can not judge about your actual question, but looking at your nested IF circus, I would suggest to try and move a bunch of these things to your script and add them there as Flag fields. Bit better for performance to. That would deduce the size of your expression here which in turn might make it easier to find the problem.

May you live in interesting times!
Not applicable
Author

I think aggr works like Group By. How do I use aggr function for lets say the following?

(count(if([Assignment Status]<>'Forwarded', [Incident #])))=0

Not applicable
Author

Lets say even If I put the following in Script also:

(if([Assignment Status]<>'Forwarded', [Incident #]))

Again, we will have to use count within a count.

That is what is actually causing the issue.

sunny_talwar

This particular expression only includes 1 aggregation function -> Count....

Can you maybe share some more information as to what you are hoping/trying to do?

Not applicable
Author

Yes One aggregation function is used. But Its like one inside another.

I am trying to get the count of Incidents according to some of the conditions which also include count.

sunny_talwar

Chetna -

I am afraid, I still don't understand your context here. Either share more information (may be like a sample or sample of data or images) or I would hope that someone else might be able to offer you better help.

Best,

Sunny

Not applicable
Author

HI,

I want this report in QlikSense. where the formula for count is what I have mentioned above.

vinieme12
Champion III
Champion III

Can you explain the calculation criteria's may be we can simplify

Not sure what you are trying to do here

count(    if(

(Status_Incidents='Closed' or Status_Incidents='Resolved'

or (Status_Incidents='Waiting' and [Assignment Status]<>'Completed')),Status_Incidents,

if((if((count(if([Assignment Status]<>'Forwarded', [Incident #])))=0,'Forwarded',

if((count(if(([Assignment Status]='Waiting' or [Assignment Status]='Accepted'), [Incident #])))=0,'Completed',

if((count(if([Assignment Status]='Accepted', [Incident #])))>0,'Accepted','Waiting')   ' Here you classify Accepted or Waiting but in the outer                                                                                                                                             if  you are considering both , why classify then?

)

))='Completed', InCompleted',Status_Incidents)

))

Can you post sample data /app and expected output

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.