Calculating percentage individual sales based on monthly total sales

Options
codewizard
codewizard Registered Posts: 6

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
    louisbarjon Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 6 Dataiker
    Options

    One way to do it it with 3 recipes :

    1. Create a group recipe based on the month column. Aggregate the sales by sum
    2. 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
    3. Create a prepare recipe that divide the sale with the sum of sales

Setup Info
    Tags
      Help me…