Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
thuesmann
Contributor
Contributor

lookup does not work correctly

Hi,

I have a SourceData table with a calculated field VNabenhoehe_WKA01_110 that contains calculated decimal numbers rounded to one decimal place.

the formula looks as follows:

round(met_WindSpeedRot_mean * pow((110/77.5),0.15), 0.1) as VNabenhoehe_WKA01_110

SourceData table:

TimeStamp StationId met_WindSpeedRot_mean VNabenhoehe_WKA01_110
01.01.2022 01:10 38 6,578205109 6,6
01.01.2022 01:20 38 6,533299923 6,5
01.01.2022 01:30 38 6,63405323 6,6
01.01.2022 01:40 38 6,766101837 6,8
01.01.2022 01:50 38 7,357340813 7,4
01.01.2022 02:00 38 7,764773846 7,8

 

Now I have another table also with the field VNabenhoehe_WKA01_110 and and a second value MatchPower that I would like to integrate into the SourceData table. Like you would do with a simple lookup funktion in excel

 

VNabenhoehe_WKA01_110 MatchPower 
0,0 100
0,1 200
0,2 300
0,3 400
0,4 500
0,5 600
0,6 700
0,7 800
0,8 900
0,9 1000
1,0 1100

 

I tried to do this via the lookup function in qlikview and it worked out quite well to a large extent. However, there are several values in the SourceData table that didn't end up with a matching MatchPower value.

Is there a problem in doing a lookup based on decimal numbers?

Do I have to use a join?

Any other suggestions?

 

Glad to get some help 😉

Labels (1)
  • Other

1 Solution

Accepted Solutions
marcus_sommer

Qlik is using a binary number-system which couldn't always provide exact frac-parts. Workarounds for such challenges may be to apply the same kind of rounding to each relevant field or just multiplying the values (10 in your case) to apply the matching against integers.

More background is here: Rounding Errors - Qlik Community - 1468808.

View solution in original post

1 Reply
marcus_sommer

Qlik is using a binary number-system which couldn't always provide exact frac-parts. Workarounds for such challenges may be to apply the same kind of rounding to each relevant field or just multiplying the values (10 in your case) to apply the matching against integers.

More background is here: Rounding Errors - Qlik Community - 1468808.