Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

user-azadi
New Contributor III

Link many fields to one field

Hi, Qliks

i have two table same below:

Base Table:

IDDescription
1Des1
2Des2
3Des3
4Des4
5Des5

Entry Table:

Entry 1Entry 2Entry 3
351
242

all of values in Entry Table , define in ID field in Base Table .

i want find Description of value of Entry Table in Base Table.

how can i do?

6 Replies
ogster1974
Honored Contributor II

Re: Link many fields to one field

Pivot your entry data on load so it looks like.

Entry
ID
13
12
25
24
31
32

Then the ID will associate automatically with your base table.

Regards

Andy

Re: Link many fields to one field

Use ApplyMap() here.

user-azadi
New Contributor III

Re: Link many fields to one field

Dear Anand , Can you explain how and write script?

Re: Link many fields to one field

If this is required that you have to load three columns of the Entry value then use.

Base_Map_Table:

Mapping LOAD * Inline [

ID, Description

1, Des1

2, Des2

3, Des3

4, Des4

5, Des5  ];

Base_Table:

LOAD * Inline

[

ID, Description

1, Des1

2, Des2

3, Des3

4, Des4

5, Des5

];



Entry_Table:

LOAD *,

ApplyMap('Base_Map_Table',[Entry 1],Null()) as Desc1,

ApplyMap('Base_Map_Table',[Entry 2],Null()) as Desc2,

ApplyMap('Base_Map_Table',[Entry 3],Null()) as Desc3;

LOAD * Inline [

Entry 1, Entry 2, Entry 3

3, 5, 1

2, 4, 2  ];



user-azadi
New Contributor III

Re: Link many fields to one field

The output I expect is:

Entry1

Description1

Entry2

Description2

Entry3

Description3

3

Des3

5

Des5

1

Des1

2

Des2

4

Des4

2

Des2

Re: Link many fields to one field

Code is same just rename the field names.

Base_Map_Table:

Mapping LOAD * Inline [

ID, Description

1, Des1

2, Des2

3, Des3

4, Des4

5, Des5  ];

Base_Table:

LOAD * Inline

[

ID, Description

1, Des1

2, Des2

3, Des3

4, Des4

5, Des5

];



Entry_Table:

LOAD *,

ApplyMap('Base_Map_Table',[Entry 1],Null()) as Description1,

ApplyMap('Base_Map_Table',[Entry 2],Null()) as Description2,

ApplyMap('Base_Map_Table',[Entry 3],Null()) as Description3;

LOAD * Inline [

Entry 1, Entry 2, Entry 3

3, 5, 1

2, 4, 2  ];

Community Browser