Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Have a requirement is that:
need to fill field_2 data based on field_1.
using lookup function.
Please elaborate little more and if possible, provide some sample data.
Have 2 tables:
table_1:
Field_2
Field_3
table_2:
Field_1
Field_2
Field_3
in table_2 if field_3 value is blank then based on Field_2 from table_2 need to lookup in Field_2 from table_1
Hi,
Use an IF and ApplyMap, something like this:
table_1:
Mapping
Load
Field_2
Field_3
from table_1.qvd;
table_2:
Load
Field_1
Field_2
If( Len(Trim(Field_3))=0, Applymap('table_1',Field_2) as Field_3
From table_2.qvd;
Best regards.
See this article
there is a part explain look up function
good luck
Fernando
Here is my example
AA:
LOAD * Inline [
Nome, Eta
Ale, 49
Ange, 47
tato, 10
Dada, 12
];
BB:
LOAD * Inline [
Eta, Fascia
10, Bimbo
12, young
47, Adult
49, Old
];
CC:
NoConcatenate
LOAD lookup('Fascia', 'Eta', Eta, 'BB') as xxx, * resident AA;
DROP Tables AA, BB;
T1:
Load * Inline
[
Field2, Field3
A, 100
B, 120
C, 200
D, 180
];
T2:
Load
Field1,
Field2,
IF(IsNull(Field3) or LEN(TRIM(Field3))=0,Lookup('Field3','Field2',Field2,'T1'),Field3) as Field3
Inline
[
Field1, Field2, Field3
F1, A, 1200
F2, B, 1400
F3, C,
F4, D,
F5, A,
];
Drop Table T1;