Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to dynamically create formulas based on field names

overhead_press
8 - Asteroid

I have one row of data and I need to create a series of calculations based on the field names. Looking at the screenshot, the values provided are [CumPD - 12] and all [df#] fields. 

 

How do I keep creating formulas like the ones in the screenshot without having to it do it manually? I need to keep creating these formulas from [CumPD - 13] to [CumPD - 300] and will be a hassle to do it manually. The pattern remains consistent as shown.

 

Thank you! 

7 REPLIES 7
apathetichell
19 - Altair

transpose - dynamically create a match logic. self join the two matched fields - this reduce your formula to value 1/value 2.

 

overhead_press
8 - Asteroid

Appreciate the response, any chance you could show me with this example dataset? 

apathetichell
19 - Altair

I'm not sure how your formula extract would work with your sample data. As I'm seeing it you'd have something like

 

(15/11)/12 for CUM PD-13 and

((15/11)/12)/13 for CUM PD-14

 

Is that the accurate formula you would expect?

overhead_press
8 - Asteroid

the calculations are separate per identifier, so for 11111 Cum PD - 13 it would be (11/1) and for 222222 it would be (15/11) 

apathetichell
19 - Altair

Hi - yup. got that. so for 22222 for CUM PD-14 you would expect 15/11/12/13 - according to your formula. I do not believe that makes any sense give your sample data.

overhead_press
8 - Asteroid

 for 22222 for CUM PD-14 it would be [CumPD - 13] / [df14] so (15/11/12)

 

The formula is: 

 

[CumPD - X] = [CumPD - X-1] / [dfX]

apathetichell
19 - Altair

Maybe this makes more sense with the actual values. The column I'm creating does use that formula.

Labels
Top Solution Authors