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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Double aggr ()

Hi All

I really need your help!

I have the following aggr in a pivot table:

aggr(max({<INDEX_Activitiy={"ABC"}>} Activities_id),Activities_ancestor_id)

The result is an ID number, lets say 2345.

this ID number, Is a key for additional field. lets say under this ID i have 3 "activities_children_id" (example: 2,5,7).

I want to count the number of "activities_children_id" under the result of the above aggr.

I tried to write the following expression:

aggr(count(activities_children_id),aggr(max({<INDEX_Activitiy={"ABC"}>} Activities_id),Activities_ancestor_id))

but I received a null value and not the required result (3).

Can someone please advise?

thanks!

Attached an example

Labels (1)
6 Replies
PrashantSangle


Hi,

Try with Only()

Try like,

aggr(count(activities_children_id),Only(aggr(max({<INDEX_Activitiy={"ABC"}>} Activities_id),Activities_ancestor_id)))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Hi,

Please can you upload sample data.

Regards

Neetha

Not applicable
Author

Hi

thank you for answering.

I Try to use the expression above but It didn't work. In the text box I get "Error in expression: Nested aggregation not allowed"

PrashantSangle

Hi,

Create Variable with 1st aggr

and used that variable in your 2nd aggr()

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi,

thanks.

that didn't helped also.. I get '-'

jmmayoral3
Creator
Creator

Try this

Count({$< Activities_id = {'= aggr(max({<INDEX_Activitiy={"ABC"}>} Activities_id),Activities_ancestor_id)'} >} activities_children_id)