Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I need your help with an expression.
I have this data set:
I must to do something like that
My purpose is to get the minimum Price of each material, and sum the difference between the Price and the minimun Price.
Difference= Price – Min. Price
Min. Price= is the minimun Price per material.
I will appreciate your help.
Hello,
In this use case scenario, you will need to use the "Aggr()" function. Here are the steps that I have followed:
1. I have loaded the dataset:
2. I have added a new measure with the expression: Aggr(NODISTINCT Min(price), material)
This will show all the minimum prices per material in a new column in the Table chart
3. I have added another measure with the expression: price - Aggr(NODISTINCT Min(price), material)
This will deduct the minimum price per material from the given price of material which will result in an table as you have mentioned in the description:
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members.
if you need totals by purchaser
sum(aggr(price-min(total <material>price),purchaser,material,price))
Hello,
In this use case scenario, you will need to use the "Aggr()" function. Here are the steps that I have followed:
1. I have loaded the dataset:
2. I have added a new measure with the expression: Aggr(NODISTINCT Min(price), material)
This will show all the minimum prices per material in a new column in the Table chart
3. I have added another measure with the expression: price - Aggr(NODISTINCT Min(price), material)
This will deduct the minimum price per material from the given price of material which will result in an table as you have mentioned in the description:
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members.
It works perfectly! Thanks a lot!!!
if you need totals by purchaser
sum(aggr(price-min(total <material>price),purchaser,material,price))
It works! Thanks!!