Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi friends,
Please can anybody tell me Mapping Table, I try it by my Best but Yet i cant understand why we use mapping table in qlikview and also how to implement it...
So plz help me ragarding with Mapping Table
Thanks,
Vishal Waghole
example
MAP:
Mapping
LOAD * INLINE [
CODICE, descr
1, ciao
2, stella
5, pippo
];
TABELLA:
LOAD
applymap('MAP',CODICE) as CODICE;
LOAD * INLINE [
CODICE
1
2
3
4
5
6
7
8
9
10
];
Execute this code and i think that tou understand the mapping use
Hi marcomasin
Thanks for rpl
but if i have following data in my inline database, And meaning of this all US, Us, U.S are same but at the time of fetching data i want show that US and all values realated to US, Us and U.S. so how we can use applymap function.
Data:
Load * Inline [
Country, Sales
US, 100
Us, 200
U.S., 300
INDIA, 400
PAK,250
];
Thanks,
Vishal
Your issue doesn't seem to have anything to do with mapping load - you need to clean up your data. In this case, you'd probably use
Purgechar(Upper(Country),'.')
In order to remove the excess periods and make everything uppercase.
Hi Vishal,
I have written a blog post on ApplyMap which has a number of examples of its use: http://bit.ly/kQcAZ5
If your data only has those values in you may want to do something simpler like:
Load
Upper(replace(Country, '.', '')) as Country,
Sales
If you want to use an applymap, which will give you far more flexibility, it will be something like:
Map_Country:
MAPPING LOAD
Country,CountryNew
INLINE [
Country,CountryNew
US,US
Us,US
U.S.US
U.S,US
];
LOAD
ApplyMap('Map_Country', Country) as Country,
Sales
This will replace all the flavours of U.S. with one consistent name and leave all other names the same. If you want to replace other names you can add them to your mapping table.
Hope that helps.
Steve
is it possible to create a mapping table outside the script, directly using QV objects ?
thanks in advance
Hi Steve,
If in case am not aware of all the list of flavours of U.S., how can I identify them to use them in the mapping table like in your example?
Thanks,
Praveena
You don't need to worry about all the possible permutations of the United States, only the ones that exist in your data. Do a search for any countries that start with U, and see how many of those would appear to be the US. You can then collect all of those in a spreadsheet or INLINE load.
The tricky part is working out which permutations you have not yet seen in your data, but may arrive. Sadly there is no way of second guessing that.
Steve