Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhas277
Creator
Creator

mapping load

Hi experts,

what is the mapping load syntax?

3 Replies
jjordaan
Partner - Specialist
Partner - Specialist

Hi prabhas,

Copied from another post.

he MAPPING statement provides an alternative to the JOIN statement in a very specific scenario: when you want to replace a single key value with a value from a lookup (mapping) table.

We prefix ' Mapping' to the load statement to tell Qlikview that a table is a mapping table.

• It can only have two columns, the first being the lookup value and the second being the mapping value to return.

• It is a temporary table. At the end of the script, QlikView automatically removes the table from the data model.

The mapping table is called with the 'Applymap()' function

Sample Code:

#####################################

Map_Price: //Mapping Table

Mapping LOAD * INLINE [

    Category, Price

    Adult, 10

    Child, 5

    Student, 6

    Senior, 6

    LoyalMember, 5

];

Tickets:

LOAD * INLINE [

    Name, Class

    Ann, Student

    David, Adult

    Sara, Senior

    Keith, Child

    Tom, Adult

    Dave, Student

    Sam, Adult

    Monica, LoyalMember

    Ethan, Student

    Rose, Child

];

Price:

Load

Name,

Class,

ApplyMap('Map_Price',Class) as TicketPrice     //Here we use applymap to look up for the ticket prices

Resident

Tickets;

Drop Table Tickets

what is mapping load and apply map?

fkeuroglian
Partner - Master
Partner - Master

Hi, see this

hope help

Fernando

Apply map

Apply Map Concept

prashantbaste
Partner - Creator II
Partner - Creator II

Hi

Mapping load has always only two fields - one is mapping field & another is its value.

So you can create Mapping table as -

MapTable:

Mapping Load mappingfieldname,

                    value

FROM maptable;

This mapping table can be used in your main data as -

ActualTable:

Load Field1, ..., Fieldn,

     mappingfieldname,

     Applymap('MapTable', mappingfieldname) as MappedValueField

FROM DATA.qvd (qvd);

This will map value of MapTable into ActualTable.

Hope this will help you to understand the concept.

--

Regards,

Prashant P Baste