Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Interpolation between 4 possible values

Hey, I need to get a value as a result of an interpolation in a double-entry table.

The table is:

- Column A

- Column B

- Column C

By giving values to A and B, I need to calculate C.

As in the double-entry table I have discrete values (ex: 5, 10, 15......) but I may need to get into the table with some other value (ex: 12,3), the result should be the consequence of an interpolation process between the four possible values.

Here is an example

example.JPG

The result should be something between 6, 7, 12 and 17.

The expression could be put in a Text Object.

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe not an optimal solution, but please find attached my proposal for kind of a linear fit.

Regards,

Stefan

View solution in original post

5 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

check this example

may be it will help you

swuehl
MVP
MVP

Maybe not an optimal solution, but please find attached my proposal for kind of a linear fit.

Regards,

Stefan

Not applicable
Author

Theres must be something wrong with my QV10 because, for both examples, no matter what values I set to parameters A and B, C is always 0..... is not working

swuehl
MVP
MVP

If you open my document, do you see any values for A, B and C? Which ones?

I noticed that there is potential issue with your numbers. I assumed that A and B are whole numbers in intervals of 5, looking at the fields, this seems to be not the truth. At least for field A, some values seem to be some 1/10000 off.

Do we need to handle unevenly spaced sampling points for A (and/or B)? I think this is going to make the whole thing a lot more complex.

Since the differences to whole integer numbers are very small, maybe this is only some kind of  error in reading the data in, if so, please check the source and the load. Would it be possible to share the source file?

Not applicable
Author

It's working fine, and it's exactly what I needed.

But, as this will be a batch process for many values, any idea on how to make it work in the script instead of the object?

Thanks