Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping Logic

Dear All,

I have an application and I want to change a dimension data with another data with the help of mapping..

Example:

Display Name(Application data) field will map to Display Name1(Excel) and Division(Application data) map to Division1(Excel).

Please reply soon..

9 Replies
sujeetsingh
Master III
Master III

use Applumap()

albertovarela
Partner - Specialist
Partner - Specialist

Step 1: Load the mapping table


NameMap:

Mapping LOAD

     Code1,

     Description1

From Sample.xlsx (ooxml, embedded labels, table is [example table]);

Step 2: Load table and apply the map

Table:

Load

     Code1,

     Name1,

     ApplyMap('NameMap', Code1, Code1) as Description  

From Sample2.xlsx (ooxml, embedded labels, table is [example table 2]);

amit_saini
Master III
Master III

Hi Rahul,

Use here applymap fuction. Mentoned below is the example:

[tmpData1]:

LOAD * INLINE [

F1,    F2

1,            100

2,            200

3,            300

4,            400

5,            500];

[Mapping1]:

MAPPING

LOAD * INLINE [

CusID,    CustName

1,    AA

2,    BB

3,    CC];

[TestApplyMap]:

LOAD

    F1    AS CustomerID,

    APPLYMAP('Mapping1',F1,'-')    AS CustomerName,

    F2    AS Amt

RESIDENT [tmpData1];

DROP TABLE [tmpData1]

Not applicable
Author

Its not working on appling Apply man.. pLz find attachment.

Not applicable
Author

I understand applymap but its not giving the right result plz find my latest attachment..

er_mohit
Master II
Master II

Try this Code as example

ADC:

MAPPING LOAD RowNo() as Key, * INLINE [

Country

  IND

AUS

  WI

  NZ

];

Map COUNTRY using ADC;

LOAD * Inline [

COUNTRY

INDIA

AUSTRALIA

WESTINDIES

NEWZELAND

];

Not applicable
Author

Yes I thought Mapping load will work but can anyone tell me how to use it in my application..

Not applicable
Author

Mapping load would be what you require from what I have understood. Maybe look into the lookup function as well. Will match a field value to a field value you want from a table you specify

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Your example QVW does it wrong. First create two mapping tables, then use them trough applymap() when loading data to be translated from any source into a resident table.

The two mapping tables have two columns: the first one is the original data, the second contains the translations. All the above examples by community members do explain how to create mapping tables.

For your case, do this:

MapPersons:

MAPPING LOAD [Display Name], [Display Name1]

FROM PutExcelSourceHere.

MapDivisions:

MAPPING LOAD [Division], [Division1]

FROM PutExcelSourceHere.

Employees:

LOAD [Display Name] AS [Original Display Name],

          applymap('MapPersons', [Display Name]) AS [New Display Name],

           [Division] AS [Original Division],

          applymap('MapDivisions', [Division]) AS [New Division],

          :

FROM PutEmployeeSourceHere;

Replace your Main 2 code with this example code, but do not forget to adapt it to your particular situation. Your document does not contain enough information for a use case.

Best,

Peter