Building Clusters, esp. Price Buckets

Brave Quicksight experts and novices!

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?!?

Thanks a ton for your kind help!!!

Hello @FelixPlatora , welcome to the Quicksight community!

When you say it doesn’t work, did Quicksight give you a specific error message or were the values that it returned in your visual incorrect?

Hi @FelixPlatora,
QuickSight 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.

Thanks,
Asem

1 Like

Dear Asem,

in a thousand years, I would not have found that out myself!
I’ll try this right tomorrow morning. Thank you so much for your help!

Cheers,

Felix

1 Like