Forum Discussion
Expression.Error: There weren't enough elements in the enumeration to complete the operation.
Not easy to debug this.
What it boiled down to is the number of words in "AUM" v "Fees paid".
This part:
{"Attribute.2", each Text.SplitAny(_,"s%"){1}}})
is going to split the column on charcters in "s%" and return the 2nd portion .
This works fine for the "Sales1%" values but breaks because the first line in the mini-table has a value of "AUM" in attribute.2 so there's nothing for the {1} to refer to. So you get an enumeration error.
Now it looks like you don't need the AUM line in the stage at all so removing it might solve your problem.
May I suggest that you aid your debugging by having the code from the function in a separate query. You can debug it step-by-step there.
- Anonymous3 years agoNot applicable
Interesting, okay. I really appreciate you taking a look - I will play around with your suggestions and see if I can't figure it out. It helps knowing where I should be looking, so thank you!