Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mithunjacob
Partner - Contributor II
Partner - Contributor II

Interpolation of values with some weird data

I have a requirement to generate values for C even for 0.10 variances of Col B. Attached is the sample set. The problem here is, most of the time the value of C is 0 and at few cases only C has values. The requirement is to generate interpolated values in Column C with respect to B (with a variance of 0.10 for B)

 pic.png

 

Labels (1)
5 Replies
uacg0009
Partner - Specialist
Partner - Specialist

Hi,
1.what kind of condition do you need to interpolate value?
2.could you please give the result that you want in your example?
mithunjacob
Partner - Contributor II
Partner - Contributor II
Author

Thank you for your reply. I am attaching my sample calculation below. Here, the requirement is to find Column C value for the value of Column B =14.85 which is not present in the table (excel).

sample cal.jpg

uacg0009
Partner - Specialist
Partner - Specialist

Hi,
thanks for clarifying the question and now I think I know the logic,
but there are also some questions:
1.In my understanding, because when the column B = 15, the value of column C is not 0, so you need to interpolate the value for 14.10, 14.20 till 14.90, right?
2.And for e.g. the calculation for column C of B = 14.10 is what you wrote above:
c1 = 0, c2 = 0.5 b1= 14.00 b2 = 14.10, and result is 0.05,
my question is when I calculate the 14.20, the c2 is still 0.5 right? not 0.05
If what I understand in 1 and 2 question are both correct, I think it's better to write a function in script firstly and call the function when load the data, maybe also need to use iterno().
Please tell me am I right for question 1 and 2, then I will try to find a method to solve it.
Aiolos Zhao
mithunjacob
Partner - Contributor II
Partner - Contributor II
Author

Thank you for the response. Please find my answers below.
1) Yes, correct. To simplify, even if the value of C is zero, we can still apply the same formula (it will not make a difference since it is 0)
2) Yes, C2 remains 0.50
uacg0009
Partner - Specialist
Partner - Specialist

Hi,

It really takes me some times to do this..but I learnt a lot from it.

I only use B=13 to 18 to test my qvw, it works, you can see my attachment and screenshot below.

Interpolation of values with some weird data.PNG

Aiolos Zhao