Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi at all,
I have this situation
Products Quantity Unit Price Total Amount
Product A 100 10 1000
Product B 50 5 250
Product A 50 10 500
Product C 10 4 40
..
..
..
Then i calculated the total amount for each product with this formula
aggr( sum(Unit_Price * Quantity),Product)
Then i would like to calc the fractile 25% using this formula
fractile(TOTAL aggr( sum(Unit_Price * Quantity),Product),0.25)
Now i would like to select a product and still obtain the correct value of fractile and so i tried with this formula
fractile(TOTAL {<Product>} aggr( sum(Unit_Price * Quantity),Product),0.25)
But if i select a product the value of fractile change and it shows me the total amount.
How can i solve it?
Andrea
Hi, try this:
fractile(TOTAL {<Products>} aggr( sum({<Products= >}[Unit Price] * Quantity),Products),0.25)
What if your removed TOTAL in your last expression
Hi, try this:
fractile(TOTAL {<Products>} aggr( sum({<Products= >}[Unit Price] * Quantity),Products),0.25)
youssefbelloum is right, in order to ignore selection in Product field, you need to ignore the selection in Products in not only your outer aggregation, but also the inner Sum()
Hi Youssef,
Thanks for your help. I have tried with {<Product>} inside the sum() but it didn't give to me the correct value but then i found my error....i was not considering a second field and so the value of fractile was wrong.
Thanks againg
Andrea
you're welcome !
don't forget to close the Thread