Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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
Hi @anthonyj
Thanks for saving my day.
Sorry for the type errors with Pressure and pressure. The apply map function worked fine.
You're welcome.