Survey banner
The Dataiku Community is moving to a new home! New posts are now disabled and the community will shortly be in temporary read only mode: LEARN MORE

Please help Prepare simple multiplication Recipe-Automation

Level 2
Please help Prepare simple multiplication Recipe-Automation


I'm a complete beginner and trying to do a simple automation after finishing core design trainings.  I have raw file that comes monthly in the format below.  There are five products below and I need to multiply each product(product will be in a text format) by their corresponding month in that row.   Please see my example below(attached the file for reference as well)

Product A & M only: I want to multiply(*) that row for each month by 6

Product  F: I want to multiply(*) that row for the months by 12

Product C 3M(30MG) & 3M(5MG): I want to multiply(*) that row by months by 3

For example: Product A: Jan-21-5*6, Feb 21-3*6, Mar-21-6*6...soo on. And I want this to be done when new months come in as well

A15 MG53643962  
C 3M30MG48684343  
C 3M5MG57658262  
0 Kudos
3 Replies


Welcome to the Dataiku Community

If I was tackling this data transformation, and wanted to do it in a visual prepare recipe.  I might fold the data into a tall format.

And then do my math in a formula.

Then if I actually wanted the data back in Wide Format I'd likely unfold the data back to the original format.

You will also want to be careful in seting up your data source so it does not to complain when the schema of the data changes when you add an additional column.

Table Setting -> Format -> Advanced OptionsTable Setting -> Format -> Advanced Options


Hope this helps.  Do let the community know how you are getting on with your project.  

0 Kudos
Level 2

Hi Tom,

Thank you for replying back.  I will do the fold but how will my math formula look like after the fold?  For example, I take Product A and I want to multiply that row for month *6?  Also, I will have new months coming, would that be automated meaning pick up?  Do you have another way of doing this simple task?

0 Kudos
Dataiker Alumni


Once you have the data in a long format (prod, month, value), then you can use a nested if to create a new column with the product: if(prod==X,3xQuantity,if(...)).

Personally, I don't like to hardcode value, therefore another suggestion is to:

  • Add a editable table with just two columns (prod, multiplier)
  • Join the two tables, using the prod as key
  • Create a new column with a simple formula of multiplier x quantity

I hope this helps.