Reputation: 23
I have Flat File1 (F1) with these columns - key1, col1, col2 Flat File2 (F2) with these columns - key2, col1, col2 and one table (T1) with these columns - key3, col1, col2
Requirement is to get data from all 3 sources based on the below checks - when key1 in Flat file (F1) matches with key2 in Flat File(F2) - return all matching rows in F1 and F2 when key1 in Flat file (F1) doesnt matches with key2 in Flat File(F2) - Only then check should be done between flat file F1 and table T1 based on condition - key1 = key3 and if match is found - then return all matching rows in T1 and F1
To acheive teh above task
Upvotes: 0
Views: 411
Reputation: 23
Cant we bring resultant outcome of both the sets of data to one common tranformation (like union) -> and from there we have to implement common logic. i.e.
Upvotes: 0
Reputation: 7387
You can follow below steps
Whole map should look like this -
sq_FF1 (master) |Grp 1 = ff1.key and ff2.key2 both NOT NULL (Matching)-------------------------------------------------> To TGT
| JNR ( ff1.key=ff2.key2) (Detail outer join) --> ROUTER -(2 groups) |Grp 2 = ff1.key is NOT NULL and ff2.key2 IS NULL (NonMatching) --> |
sq_FF2 (Detail) | JNR key1 = key3 (inner join) ---> To TGT
sq_T1 -----------------------------------------------------------------------------------------------------------------------------------------> |
Upvotes: 0