Issue with Counting Containers Based on Fill Rate

Hi all,
I’m facing an issue with nested aggregation while trying to count containers with a fill rate of less than 50%.(Please see below)

I’ve already calculated the container fill rate for each container. Now, I want to count how many containers have a fill rate < 50%. Here’s the formula I tried:
countIf({container_id},{tote fill rate}<0.5)

However, this gives me a “nesting of aggregate functions” error.
image

Is there a workaround to count the number of containers with a fill rate less than 50%? I’ve tried all the methods I know but haven’t had success so far. Any help would be appreciated!

1 Like

Hi @cijod,

Can you show your calculated field for the fill rate?

@David_Wong its {total volume}/49000

Total volume is calculated by sum(quantity*volume)

Hi @cijod,

You can’t use sum inside count (that’s what that error message means) but you can use sumOver instead. Can you try this calculated field for the fill rate instead?

sumOver(quantity*volume, [{container id}], PRE_AGG) / 4900