Here is some code in the load script using apply map
Step 1: Create Mapping Table. This table is loading in the Alpha2CountryCode and DimCountryID from a QVD that stores country information.
Mapping LOAD DimCountryID,
Step 2: Apply this map to transaction table. This will return the Alpha2CountryCode when i provide a valid ID. Otherwise Unknown.
ApplyMap ('ISOCode', BookingLocationDimCountryID,'Country_Unknown')
In my transactions table I had a number of CountryIDs. This example uses the booking location. Essentially I am just passing the value of this ID into the mapping load. E.g. if the mapping load has the following and BookingLocationDimCountryID is 3, the apply map function will return SE.
Please check enclosed example.
Also note that
1) Mapping Table should be loaded before the table in which ApplyMap need to be used
2) Mapping Table should be having exactly two columns.
ApplyMap.qvw 147.5 K
I cant upload an example, but here is some screen prints
I created a qvd of a mapping table containing 2 columns
I need to add Warehouse Description to my Chambers Table that contains a common field of Warehouse
Then in my chamber table I use the ApplyMap function to lookup against my mapping table above, so I can add the Warehouse Description to Chamber Table
Basically it has allowed me add the Warehouse Description to my Chambers table, like you would use the VLOOKUP Function in Excel
I hope that helps
Hello My friend, I want to learn how i can use the Mapping sentence and Applymap function. I have the following script, but it doesn't work. Coul you help me please? Thanks.
mapping LOAD * INLINE [
@1 as id,
@2 as Nombre,
@3 as Ciudad,
ApplyMap('map1',valor,'descnonoci') as valor
(txt, codepage is 1252, no labels, delimiter is ',', msq);
The second parameter of the ApplyMap function is the field that you are mapping on to, I would expect this to be either @1, @2 or @3 - depending on which field contains the values a1,a2,a3 and a4.
The blog post I reference below has quite a lot of detail on the various options for the parameters.
Hope that helps.
You may find my blog post on ApplyMap useful, it details the basic and more advanced syntax of the command:
To answer your question about the field names; unlike fields that associate in the data model (where name matching is critical) there is no need to match the fieldnames with Mapping tables. It only matters which field you load as column one (this is the field you are matching) and column two (the value you are applying).
Once you get your head around how to use ApplyMap you will find it an elegant way of solving many data load challenges.
loading the data from previously loaded table
if example i have 100 fields in one table but for my work i want only 5 fields that time i simply go with like
by using resident: u want only banana ,jama means
resident products; - so simply u can load fields which u want , no need to load all
( 5 to 6 fields u can go for comment , if 100 fields are there and u want only 5 that case we use resident)
when we have more than one common field between 2 tables then we get synthetic key
ways to remove:
qualifier and unqualifier ,
Ekkada nerchukuntunaru vishnu priya
if this answer helpful to u pls make it as a correct answer
what is the use of resident:
If you want to apply any transformation just use resident load for groupby and order by and having by clauses like that we can use resident load instead of doing normal load.it will give gud performance.already existing table if we wwant to load once again that is called resident load.\
why we will get synthatic keys:
if we have morethan 1 common key in moretahn 1 table then the synthetic key table will form.it will give may or maynot perfect result better to avoid it.
to remove synthetic keys:
qualifier and unqualifier statement ,