Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I have the following problem with a table Diagramm.
I got different collumns with a Costumer, ID (for the Product he bought), and the Price. Each Costumer could have bought more Products, so there is a new line for every Product
Costumer | ID | Price |
---|---|---|
Shaun Williams | 55 | 400 |
Shaun Williams | 66 | 500 |
Shaun Williams | 77 | 300 |
Maria Franklin | 11 | 777 |
Maria Franklin | 22 | 200 |
Maria Franklin | 33 | 350 |
Maria Franklin | 44 | 378 |
Maria Franklin | 55 | 400 |
Maria Franklin | 66 | 500 |
Albert Einstein | 1 | 152 |
Albert Einstein | 13 | 757 |
Now, I want to make a table, where only the most expensive Product is listed the costumer bought.
Costumer | ID | Price |
---|---|---|
Shaun Williams | 66 | 500 |
Maria Franklin | 11 | 777 |
Albert Einstein | 13 | 757 |
I tried to set the Dimension Costumer and the Functions:
If(rank(Price)=1,ID,Null())
Aggr(If(rank(Price)=1,Price),Price)
But then I only get a table, where everything is Null() except for the highest Price in the Data.
How can I filter the Data so that every Costumer is listed like in the second table?
Thanks a lot in advance!
Alex
So,
use Costumer and ID as dimensions
and expression:
if(Price=max(TOTAL <Costumer> Price),Price)
What you want to do if you will have more than one product with this max price for each customer?
Hey Dariusz,
if there are more products with a max price, than there should be an extra row or more if needed.
Use the below expression:
=if(Aggr(Rank(Sum(Price)), Costumer) =1 , Costumer)
So,
use Costumer and ID as dimensions
and expression:
if(Price=max(TOTAL <Costumer> Price),Price)
Thanks a lot for your Help Dariusz, it works