Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have
Table_A:
Load
A,
B,
C
From QVD1
Table_B:
Load
A,
F,
G
From QVD2
I want to combine into one table so I can apply logic on fields from both of the tables ie
if B=1 and G=2, 'Pass','Fail' as New_Field
My solution is :
---------------------------------------------------------------------------------
Table_A:
Load
A,
B,
C
From QVD1
Concatenate(Table_A)
Load
A,
F,
G
From QVD2
Qualify *;
New Table:
No concatenate
Load*,
if B='1' and G='2', 'Pass','Fail' as New_Field
Resident Table_A
Unqualify *;
Drop TABLE Table_A;
---------------------------------------------------------------------------------------
The issue is when I run this and look at the tables there is no relationship between say fields B and G even though they are linked via A.
I'm sure there is a simple issue at play here. How would I go about getting the correct outcome ?
concatenating will just append the tables instead try joining the tables on the key A then compare.
Table_A:
Load
A,
B,
C
From QVD1
Join(Table_A)
Load
A,
F,
G
From QVD2
Qualify *;
New Table:
No concatenate
Load*,
if B='1' and G='2', 'Pass','Fail' as New_Field
Resident Table_A
Unqualify *;
Drop TABLE Table_A;
concatenating will just append the tables instead try joining the tables on the key A then compare.
Table_A:
Load
A,
B,
C
From QVD1
Join(Table_A)
Load
A,
F,
G
From QVD2
Qualify *;
New Table:
No concatenate
Load*,
if B='1' and G='2', 'Pass','Fail' as New_Field
Resident Table_A
Unqualify *;
Drop TABLE Table_A;
Thank you Aar this seems to work well for my problem