Create calculated field using aggregate and non-aggregrated field

Q10 → percentile(X,10) and so on.
I am trying to create the following but getting mismatched aggregation error
X_bins =
ifelse(X <= Q10, 1,
ifelse(X <= Q20, 2,
ifelse(X <= Q30, 3,
ifelse(X <= Q40, 4,
ifelse(X <= Q50, 5,
ifelse(X <= Q60, 6,
ifelse(X<= Q70, 7,
ifelse(X <= Q80, 8,
ifelse(X <= Q90, 9, 10)
)
)
)
)
)
)
)
)

Hi @shefalim

Can you please try creating Q10 as percentileDiscOver(Sales,10,[],PRE_AGG) in this case am calculating percentile at entire without any grouping and use it to bin .

image

Thanks
VInod

I would need the percentile to change with the date filter. Will this support that?

Hi @shefalim,
It’s been awhile since last communication in this thread; did you test out the solution provided above and if so, did it work for your case or do you have any additional questions?

If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.

Thank you!

Hi @shefalim,
Since we haven’t heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!