Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, Qliks
i have two table same below:
Base Table:
ID | Description |
---|---|
1 | Des1 |
2 | Des2 |
3 | Des3 |
4 | Des4 |
5 | Des5 |
Entry Table:
Entry 1 | Entry 2 | Entry 3 |
---|---|---|
3 | 5 | 1 |
2 | 4 | 2 |
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?
Pivot your entry data on load so it looks like.
Entry | ID |
---|---|
1 | 3 |
1 | 2 |
2 | 5 |
2 | 4 |
3 | 1 |
3 | 2 |
Then the ID will associate automatically with your base table.
Regards
Andy
Use ApplyMap() here.
Dear Anand , Can you explain how and write script?
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 ];
The output I expect is:
Entry1 | Description1 | Entry2 | Description2 | Entry3 | Description3 |
3 | Des3 | 5 | Des5 | 1 | Des1 |
2 | Des2 | 4 | Des4 | 2 | Des2 |
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 ];