Announcing the winners & finalists of the Dataiku Frontrunner Awards 2021! Read their inspiring stories

How to find a dyanic mean of column in Formula in prepare recipe

NilamberPanda
Level 2
How to find a dyanic mean of column in Formula in prepare recipe

I have 3 columns Average transaction value, frequency and lifespan. I am trying to do a maths formula in prepare recipe by multiplying

Average transaction value* frequency * average (lifespan)

How can I calculate the average(lifespan) dynamically in the prepare recipe formula itself?

0 Kudos
1 Reply
fchataigner2
Dataiker
Dataiker

Hi,

if by "average(lifespan)" you mean "average on some group of rows" (maybe on the full dataset), then you need to use the Window recipe. 

The Prepare recipe operates purely row-by-row, and to compute values on group of rows you need to either do a Group recipe then join back the aggregates on the data, or use a Window recipe to do it in one go.

0 Kudos
A banner prompting to get Dataiku DSS