Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a table which is of format
customer_id | company | cat |
1 | amazon | furniture |
1 | amazon | technology |
2 | amazon | furniture |
3 | airpods | |
3 | amazon | technology |
4 | amazon | clothes |
4 | amazon | watch |
5 | ikea | furniture |
I am trying to calculate a meausre
count customer id who have more than 2 differnt cat from amazon / total customers who bought on amazon |
1 | amazon | furniture |
1 | amazon | technology |
2 | amazon | furniture |
3 | amazon | technology |
4 | amazon | clothes |
4 | amazon | watch |
output:2/4
how can this be achieved front end
My measure at the moment if((aggr(count({<company={'amazon'}>}distinct cat),customer_id)>2),1,0)
Hi
Try like below
=Count({<customer_id ={"=Count({<company = {'amazon'}>} cat)>=2"}>} DISTINCT customer_id) / Count({<company = {'amazon'}>}DISTINCT customer_id)