Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
joybratas1
Contributor II
Contributor II

Inner Joint is not joining rather repeating its values

Hi, 

I am pretty new in Qlikview. I am stuck in a problem while Loading the script. I have 2 tables with one common field 'Weather_Field'. The table that is to be joined has symbols of the values in Weather field-

Weather Field           Units

 Temperature              *F

  Humidity                      %

  Pressure                     Millibars

 

I want to get the Units column of this table to be integrated to the first table. 

Sample-

State     value     Weather_Field  

 Albama   5.9         Temperature

 Alaska      210        pressure

Ohio           19.7       Temperature

 

 

 

So I want the Units to be joined in this table. 

 

Please help. 

Labels (1)
1 Solution

Accepted Solutions
anthonyj
Creator III
Creator III

Hi @joybratas1,

Instead of doing an inner join, try using the applymap() function instead. It's faster than joining tables.

UnitsMap:

mapping

load distinct 

Weather_Field,

Units

from DataFile.qvd;

Weather:

load

Weather_Field,

applymap('UnitsMap', Weather_Field, null()) as Unit,

State,

value

From WeatherDataFile.qvd;

Things to consider are to make sure that there is only one value for each of the categories in your Weather_Field (eg. Temperature not mapping to Fahrenheit and Celsius so as not cause duplication.  That the Weather_Field values have the same case. Either lower, upper or proper case. I noticed that your example has "Pressure" and "pressure". These won't match and would need to be cleaned first.

I hope this helps.

Thanks

Anthony

 

View solution in original post

3 Replies
anthonyj
Creator III
Creator III

Hi @joybratas1,

Instead of doing an inner join, try using the applymap() function instead. It's faster than joining tables.

UnitsMap:

mapping

load distinct 

Weather_Field,

Units

from DataFile.qvd;

Weather:

load

Weather_Field,

applymap('UnitsMap', Weather_Field, null()) as Unit,

State,

value

From WeatherDataFile.qvd;

Things to consider are to make sure that there is only one value for each of the categories in your Weather_Field (eg. Temperature not mapping to Fahrenheit and Celsius so as not cause duplication.  That the Weather_Field values have the same case. Either lower, upper or proper case. I noticed that your example has "Pressure" and "pressure". These won't match and would need to be cleaned first.

I hope this helps.

Thanks

Anthony

 

joybratas1
Contributor II
Contributor II
Author

Hi @anthonyj 

Thanks for saving my day. 

Sorry for the type errors with Pressure and pressure. The apply map function worked fine. 

anthonyj
Creator III
Creator III

You're welcome.