Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have received requirement below:
Table A:
Id | Name |
---|---|
1 | A |
2 | B |
3 | C |
4 | D |
5 | E |
Table B:
Id | value |
---|---|
1 | 10 |
3 | 20 |
5 | 11 |
Table C
Name | value |
---|---|
B | 13 |
D | 23 |
Target Table:
Id | Name | Header 3 |
---|---|---|
1 | A | 10 |
2 | B | 13 |
3 | C | 20 |
4 | D | 23 |
5 | E | 11 |
How to combine Table A,B,C to Target Table?
Best Regards.
Louis
Map1:
mapping LOAD Id,
value
FROM
[https://community.qlik.com/thread/268497]
(html, codepage is 1252, embedded labels, table is @2);
Map2:
mapping LOAD Name,
value
FROM
[https://community.qlik.com/thread/268497]
(html, codepage is 1252, embedded labels, table is @3);
Data:
LOAD Id,
Name,
alt(ApplyMap('Map2',Name,Null()),ApplyMap('Map1',Id,Null())) as Value
FROM
[https://community.qlik.com/thread/268497]
(html, codepage is 1252, embedded labels, table is @1);
Map1:
mapping LOAD Id,
value
FROM
[https://community.qlik.com/thread/268497]
(html, codepage is 1252, embedded labels, table is @2);
Map2:
mapping LOAD Name,
value
FROM
[https://community.qlik.com/thread/268497]
(html, codepage is 1252, embedded labels, table is @3);
Data:
LOAD Id,
Name,
alt(ApplyMap('Map2',Name,Null()),ApplyMap('Map1',Id,Null())) as Value
FROM
[https://community.qlik.com/thread/268497]
(html, codepage is 1252, embedded labels, table is @1);
Try:
map_TableB:
MAPPING
LOAD
id,
value
FROM [Table B]
map_TableC:
MAPPING
LOAD
Name,
value
FROM [Table C]
TargetTable:
LOAD
id,
name
APPLYMAP('map_TableB', id, APLLYMAP('map_TableC', Name)) AS Header3
FROM [TABLE A]
You define the Table C map as the default mapping in case Table B doesn't have matching values.
Uri