Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Interpolation between Years

mark_paul
8 - Asteroid

Hi,

 

How to achieve interpolated between years and get the values?

 

 

Source 1:

YearValue
11.3456
21.45678
32.223456
42.98765
51.9876
61.32456
71.435678
82.213456
90.98765
102.123456

 

 

Target:

IDYear_1Interpolated_value
1002.124Interpolated (((2.223456-1.45678)/(3-2)) * (2.124-2) + 1.45678) =1.551847824
1013.987((2.98765-2.223456)/(4-3)) * (3.987-3) + 2.223456 = 2.977715478
1026.12Interpolated between 6 and 7
1035.432Interpolated between 5 and 6
1049.765Interpolated between 9 and 10
1058.432interpolated between 8 and 9
10671.435678
1074.378interpolated between 4 and 5

 

 

 

Thanks,

Mark

13 REPLIES 13
patrick_digan
17 - Castor
17 - Castor

@mark_paul I've attached an example using the ceil and floor function to join the 2 data points and then calculate the output.

mark_paul
8 - Asteroid

@patrick_digan ,

 

Thanks for your quick response.

 

what if one of the year is missing?  for example year 8 is not available in the source then need the interpolation between 7 and 9. How to achieve this?

 

YearValue
11.3456
21.45678
32.223456
42.98765
51.9876
61.32456
71.435678
90.98765
102.123456

 

 

Thanks,

Mark

afv2688
16 - Nebula
16 - Nebula

Hello @mark_paul ,

 

Does this help?

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

RolandSchubert
16 - Nebula
16 - Nebula

Hi @mark_paul ,

 

it's possible to o it using Transpose and Multi-Row Formula tool. I've attached a sample workflow.

 

Best,

 

Roland

mark_paul
8 - Asteroid

@afv2688 ,

 

Its not working for below source when interpolating between 7 and 9 for computing the 8.432

 

YearValue
11.3456
21.45678
32.223456
42.98765
51.9876
61.32456
71.435678
90.98765
102.123456

 

 

Thanks,

Mark

mark_paul
8 - Asteroid

@RolandSchubert ,

 

I tried with below source data its not working for interpolation between 7 and 9 when computing 8.432 value?

 

YearValue
11.3456
21.45678
32.223456
42.98765
51.9876
61.32456
71.435678
90.98765
102.123456

 

Thanks,

Mark

afv2688
16 - Nebula
16 - Nebula

Hello @mark_paul ,

 

Have updated the workflow. Forgot to add something

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

afv2688
16 - Nebula
16 - Nebula

Hello @mark_paul,

 

Added a nice touch to filter out all the fields that are out of the interpolation limits.

 

Untitled.png

 

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

RolandSchubert
16 - Nebula
16 - Nebula

Should work now, if years are missing ... added some "find nearest upper/lower" calculation

Labels