Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Interpolation formula

Hi all,

How to implement intepolation formula in qlikview

6 Replies
ramasaisaksoft

Hi Hari,

May i know what out put u required?

Can u give sample input and expected output on that data so that we will help to you properly.

Not applicable
Author

Sales  year

1000   1002

1500    998

Above table having for year 1002 i have sales is 1000

And for 998, i have 1500

I need sales for year 1000.

sunny_talwar

And how would you calculate this outside of QlikView?

Not applicable
Author

Hi sunny,

In  above example

1500+(1000-998)*((1000-1500)/(1002-998))

In qlikviw need to use bellow formula

: (((Y2-Y1)/(X2-X1)*(X-X1))+Y1

Here X is our selected date

X1 is prev date

X2 is next date

Y1 is prev sales

Y2 is next sales

Above is interpolation formula

MarcoWedel

Hi,

I guess you don't have to implement this expression manually but you can use the functions Linest_M and Linest_B for your requirement:

QlikCommunity_Thread_218974_Pic1.JPG

QlikCommunity_Thread_218974_Pic2.JPG

hope this helps

regards

Marco

Not applicable
Author

Hi Marcro Wedel,

Thank you for spending time for me.

I didn't get the correct output. I sharing some sample data, can you please how to implement this. using interpolation formula.

id            sales                                             year

10      0.000000512502                            1000.48

7        0.00000014555170041714             1000.33

9        0.000005599950                              994.77

8         :

           :

           :

22    0.0000000234178405434600            500.47

20     0.0000040797644                             499.46

expected output is

year                   sales

1000           2381

500            1813

Formula:

Sales=Sales1+(year-year1)*(sales2-sales1)/(year2-year1)

where year is expected output year like 1000,500....

year1 is below expected year, year2 is above expected year

same for sales.

Thanks.