I am trying to create buckets to cluster the products in my analysis by their price levels, i.e. sort them by e.g. “<=€50”, “>€50 AND <=€100” and so on…
As I do not have product data in the data lake (yet), I need to approximate by the average of the sold prices from the order data, instead.
To me as a beginner, it looks super straight forward to do this as follows:
ifelse(avg({item_price_gross_euro}) <= 50, ‘B1: <=50€’, 0) // using 0 here instead of further clusters for simplification
Well, guess what? Doesn’t work. Neither does: ifelse(sum({item_price_gross_euro}) <= 50, ‘<=50€’, 0)
I know you know - but I don’t get it. What am I missing here?!?
Hi @FelixPlatora,
Quick Sight will show an error as your conditions in the ifelse are of mixed type.
Your Then clause ‘B1: <=50€’ is a string (in quotes) while your Else is a number (0). Can you modify these to be the same type? You can change the 0 to ‘0’. That should fix your issue.