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: 
Not applicable

Applymap()

Can any body give me  two real time examples for applymap() where it best suits and

with all benfits by using applymap()

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

There are so many examples of the Applymap and mapping is used with two fields and it is apply to the table. To facilitate the table with additional field details with the description.

See the below small example

1. See the below simple example from help

Purchase:

LOAD * Inline [

PurchaseID,Product,PurchasePrice,Quantity,PurchaseDate

P9, Product1, 8,  20, 15/10/2010

P11, Product1, 7,  10, 09/10/2010

P12, Product1, 9,  20, 01/10/2010

];

Temp:

Mapping LOAD

Product,PurchasePrice

Resident Purchase;

DROP Table Purchase;

Sales:

LOAD ApplyMap('Temp', Product ) as PurchasePrice,* Inline [

SalesID,Product,SalesPrice,Quantity,SalesDate

S1, Product1, 10,  10, 10/10/2010

];

2. Also small example

CustomerTable:

Mapping Load * Inline

[

  CustomerID, Country

  A, Germany

  B, France

  C, Italy

];

Sales:

Load *,

  ApplyMap('CustomerTable', CustomerID, 'Unknown') as CustomerCountry

Inline

[

  CustomerID, Month, Sales

  A, Jan, 100

  B, Jan, 200

  C, Jan, 300

  D, Feb, 150

  E, Mar, 200

];

View solution in original post

4 Replies
swuehl
MVP
MVP

What do you mean with 'real time' examples?

If you search the forum, you'll find plenty examples, also discussions about pros & cons.

its_anandrjs
Champion III
Champion III

There are so many examples of the Applymap and mapping is used with two fields and it is apply to the table. To facilitate the table with additional field details with the description.

See the below small example

1. See the below simple example from help

Purchase:

LOAD * Inline [

PurchaseID,Product,PurchasePrice,Quantity,PurchaseDate

P9, Product1, 8,  20, 15/10/2010

P11, Product1, 7,  10, 09/10/2010

P12, Product1, 9,  20, 01/10/2010

];

Temp:

Mapping LOAD

Product,PurchasePrice

Resident Purchase;

DROP Table Purchase;

Sales:

LOAD ApplyMap('Temp', Product ) as PurchasePrice,* Inline [

SalesID,Product,SalesPrice,Quantity,SalesDate

S1, Product1, 10,  10, 10/10/2010

];

2. Also small example

CustomerTable:

Mapping Load * Inline

[

  CustomerID, Country

  A, Germany

  B, France

  C, Italy

];

Sales:

Load *,

  ApplyMap('CustomerTable', CustomerID, 'Unknown') as CustomerCountry

Inline

[

  CustomerID, Month, Sales

  A, Jan, 100

  B, Jan, 200

  C, Jan, 300

  D, Feb, 150

  E, Mar, 200

];

maxgro
MVP
MVP

outside this forum you can read this (add www)

quickintelligence.co.uk/applymap-is-it-so-wrong

Joseph_Musekura
Support
Support

Hi,

Please check these 2 samples one  with "Map ... Using" and another with "ApplyMap"

Thanks!