Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, in the below sample data can you please help me in loading only the required data
INPUT
| ID | Code | Value |
| 1 | TAC_FX | 10 |
| 1 | TAC | 15 |
| 2 | TAC_FX_ADJ | 20 |
| 2 | TAC_ADJ | 25 |
| 3 | TAC | 35 |
| 4 | TAC_ADJ | 40 |
| 5 | TTT | 50 |
OUTPUT
| ID | Code | Value |
| 1 | TAC_FX | 10 |
| 2 | TAC_FX_ADJ | 20 |
| 3 | TAC | 35 |
| 4 | TAC_ADJ | 40 |
basically, the idea is like, Qlik should check and load
- the records which contain TAC_FX, TAC_FX_ADJ, first
- if these are not presented, then it should check for the records containing TAC, TAC_ADJ
else it should not fetch.
Kindly assist me, Thank You
Hi,
You can try a script like this :
Data:
Load
*
Inline [
ID, Code, Value
1, TAC_FX, 10
1, TAC, 15
2, TAC_FX_ADJ, 20
2, TAC_ADJ, 25
3, TAC, 35
4, TAC_ADJ, 40
5, TTT, 50
];
Data2:
Load
*,
ID as ID_EXIST
Resident Data
Where
Match(Code, 'TAC_FX', 'TAC_FX_ADJ')
;
Concatenate(Data2)
Load
*,
ID as ID_EXIST
Resident Data
Where
not Exists(ID_EXIST, ID)
and Match(Code, 'TAC', 'TAC_ADJ')
;
Drop Table Data;
Hi,
You can try a script like this :
Data:
Load
*
Inline [
ID, Code, Value
1, TAC_FX, 10
1, TAC, 15
2, TAC_FX_ADJ, 20
2, TAC_ADJ, 25
3, TAC, 35
4, TAC_ADJ, 40
5, TTT, 50
];
Data2:
Load
*,
ID as ID_EXIST
Resident Data
Where
Match(Code, 'TAC_FX', 'TAC_FX_ADJ')
;
Concatenate(Data2)
Load
*,
ID as ID_EXIST
Resident Data
Where
not Exists(ID_EXIST, ID)
and Match(Code, 'TAC', 'TAC_ADJ')
;
Drop Table Data;