WLS-D
2
Hello @miap !
Can you try this:
sumOver(
minOver(
ifelse(
{Current Life cycle week} <= {week num},
minOver({flowers ratio expected}, [{crop type}, {week num}], PRE_AGG) *
minOver({Current growing plants},[{batch id}], PRE_AGG) /
ifelse({flower size} = 'L' OR {flower size} = 'M', 5, ifelse({flower size} = 'S', 20, 0)),
0
),
[{Expected week date}, {crop type}, {batch id}], PRE_AGG),
[]. PRE_AGG)
I would also check out this blog post: