Calculating percentage individual sales based on monthly total sales
code_wizard
Registered Posts: 8 ✭✭
I have a dataset with two columns representing individual sales values and another column representing the month. I want to create an additional column that calculates the percentage of individual sales values relative to the total sales values for each month.
Answers
-
louisbarjon Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 9 Dataiker
One way to do it it with 3 recipes :
- Create a group recipe based on the month column. Aggregate the sales by sum
- Create a join recipe that will join your whole dataset with the grouped dataset you just created, select left join. And join on the month
- Create a prepare recipe that divide the sale with the sum of sales