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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to map the data

Hello,

I've the data in my qvd file like this..

ABC
121
221
321
421
111
211
311
411

Using Mapping concept i want to generate the data as shown below how can i generate it.

ABCABCD
1218
2216
3214
4212
1117
2115
3113
4111

What is the code for this concept?

1 Solution

Accepted Solutions
Not applicable
Author

I got the solution for this..

Temp:

Load * Inline [

A,B,C,ABCD

'1','2','1','8'

'2','2','1','6'

'3','2','1','4'

'4','2','1','2'

'1','1','1','7'

'2','1','1','5'

'3','1','1','3'

'4','1','1','1'

];

Map1:

Mapping

LOAD

A & B & C as key,

ABCD

Resident Temp;

DROP Table Temp;

T2:

LOAD 

          A,

     B, C,ApplyMap('Map1',A & B & C,Null()) as ABCD

FROM

QVD\TFile.qvd

(qvd);

View solution in original post

4 Replies
jvitantonio
Specialist III
Specialist III

Can you explain the logic behind this tables?

martinpohl
Partner - Master
Partner - Master

Hello Jacq,

first step mapping table

Mappingtab:

mapping load

A&B&C as Key,

D from source;

then in the second table

load *,

applymap('Mappingtab',A&B&C,0) as ABCD

from source;

Regards

Not applicable
Author

If you  observe  the first table for each combination i'm assigning one value in second table.

For eg:

The data of the columns A,B,C -> ABCD

1,2,1 ->8

2,2,1 ->6

3,2,1 ->4

4,2,1 ->2

.

.

.

Not applicable
Author

I got the solution for this..

Temp:

Load * Inline [

A,B,C,ABCD

'1','2','1','8'

'2','2','1','6'

'3','2','1','4'

'4','2','1','2'

'1','1','1','7'

'2','1','1','5'

'3','1','1','3'

'4','1','1','1'

];

Map1:

Mapping

LOAD

A & B & C as key,

ABCD

Resident Temp;

DROP Table Temp;

T2:

LOAD 

          A,

     B, C,ApplyMap('Map1',A & B & C,Null()) as ABCD

FROM

QVD\TFile.qvd

(qvd);