Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following load in tab 1 i have
LOAD
SIAA.C_ID as [Customer ID],
SIAA.C_NAME as [Customer name]
FROM
[$(vDetailsQVDDirectory)\SIAA.qvd]
(qvd);
Then in tab 2 i have
PreIT:
Concatenate
LOAD
[Customer ID],
[Customer name]
FROM
[$(vDetailsQVDDirectory)\CTA.qvd]
(qvd);
What i want is if there is a matching Customer ID in both tabs i want it to only use the name from tab 1 (SIAA.C_NAME)
i want to achieve this without mapping
Try Joining as mentioned by Kush may be
Ok this has linked them and works for the ones in both tables and uses the correct name.
HOWEVER now ones that are in table 1 but not in table 2 are missing
do i need to do a left join?
Have you cleared out all the selection? I would think that the data should be there, might be filtered out due to selections
I think you need to perform outer join
Actually with a join still getting duplicate id from both table where name is different
Yes because the assumption here would be that a single ID will be associated to one and only one name. If that is not true then choose whichever table has the correct names and comment out the name in the other table while joining the two tables.
tried this, just brings the same thing through except the names i dont want are all "-"
I think Customer Name is not consistent in your table.
Data:
LOAD
SIAA.C_ID as [Customer ID],
SIAA.C_NAME as [Customer name]
1 as Flag1
FROM
[$(vDetailsQVDDirectory)\SIAA.qvd]
(qvd);
join (Data)
LOAD
[Customer ID],
[Customer name] as [Customer name1]
2 as Flag2
FROM
[$(vDetailsQVDDirectory)\CTA.qvd]
(qvd);
Final:
noconcatenate
LOAD distinct [Customer ID],
if( len(trim(Flag1))>0 or (len(trim(Flag2))>0 and len(trim(Flag1))>0), [Customer name],
[Customer name1] ) as [Customer ID]
resident Data;
drop table Data;
Field names must be unique within table
Final:
noconcatenate
LOAD distinct [Customer ID],
if( len(trim(Flag1))>0 or (len(trim(Flag2))>0 and len(trim(Flag1))>0), [Customer name],
[Customer name1] ) as [Customer ID]
resident Data