Discussion board where members can get started with Qlik Sense.
I've been trying and trying to figure this out (I read some many threads about it as well) but I can't handle my data to reach my goal.
Here is the story with a table (the calculation is made with excel):
I need to calculate the weighted average discount rate for all articles
For each article, I've got public price, quantity and sales.
To get the discount rate I need to calculate the Average selling price as "Sales/Quantity"
Then I am able to calculate the discount rate for each article as "1-(Average selling price/Public Price)"
Final step to get the "Weighted Discount rate" I do :
How would you do it within Qlik Sense? I am able to get a good discount for each article, when the total is not right !
That's my closest formula
I've enclosed the sample in a .xlsx file
Thank you in advance for your precisous help
=Sum(Aggr((1 - (Sum(Sales)/Sum(Quantity)/Sum([Public Price]))) * Sum(Quantity), [Article code])) /Sum(Quantity)
View solution in original post
You're a god ! It's working.
Good news for the coming weekend 🙂
Do you know why my attemp was not working and that I needed to aggr on the article (as my table with filtered on article)?
Because for the total row... you wanted to sum the multiplication of discount rate and quantity... you need to sum them otherwise the total row will also be done as any other row.