Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kderose
Contributor II
Contributor II

Linear Interpolation

Is there a way to do a linear interpolation using a database feed and a lookup table? We receive continuous data from our onsite monitoring, and we need to lookup a reference table(see below) to get an output. The value of the continuous data references the first column and then interpolated output based on the second column is produced.

  For example, if we receive a value of 590.10ft, we would like to get an answer of ~13.4cfs.  We currently have excel spreadsheets and some old Python code that can produce this but is this possible using TOS?

 

[ft] [cfs]
0 0
590 0
590.02 7
590.09 65
590.13 112
590.18 183
590.2 215
590.25 300
590.28 356

 

 

Labels (3)
3 Replies
Anonymous
Not applicable

Yes. Just translate your Python code into Java and apply it in a Job.

kderose
Contributor II
Contributor II
Author

Unfortunately, re-purposing the old python code isn't an option for us.

Anonymous
Not applicable

OK, well this may work for you.....

http://www.java2s.com/Code/Java/Collections-Data-Structure/LinearInterpolation.htm

 

You can plug that code into a Talend routine and use to carry out your calculation