
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count condition error: nested aggregation not allowed
Hello!
I'm trying to count all the departaments that satisfies a condition. This is the condition:
if(( AVG(STANDAR_COST)
-
((NUM(SUM({<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} BENEFIT) /
SUM({<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} HOURS),'###.##0,00'))
))<0,1,0)
Now I would have to get a number that indicates the number of the departaments that satisfies that condition. So I'm doing something like this:
=count({<Departament>} if(( AVG({<Departament>}STANDAR_COST)
-
((NUM(SUM({<Departament>}{<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} BENEFIT) /
SUM({<Departament>}{<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} HOURS),'###.##0,00'))
))<0,1,0)
But I get the error: nested aggregation not allowed
Any idea? Thank you so much
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
Sum(Aggr(
if(( AVG(STANDAR_COST)
-
((NUM(SUM({<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} BENEFIT) /
SUM({<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} HOURS),'###.##0,00'))
))<0,1,0),
Departament))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
Sum(Aggr(
if(( AVG(STANDAR_COST)
-
((NUM(SUM({<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} BENEFIT) /
SUM({<MONTH={$(=NUM($(=MAX({<ID_CLASS={$(Total_Cost)}>}MONTH)),'00'))}>} HOURS),'###.##0,00'))
))<0,1,0),
Departament))
