Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have some questionnaire data structured as follows:
| Table 1 | ||||||||
| Date | EMPID | CID | FID | UID | ||||
| Table2 | ||||||||
| Fnumber | FID | UID | ||||||
| Table3 | ||||||||
| Text | TID | |||||||
| Table4 | ||||||||
| Fnumber | FID2 | FID | TID | |||||
| Table5 | ||||||||
| MainID |
I would like to merge or combine this data into a single table and save in the following manner
FinalTable
Date EMPID FNumber Text
But, there are a few conditions which needs to be considered:
Table2.Fnumber=Table4.FNumber
And Table4.TID=Table3.TID
And Table2.FID=Table4.FID
And Table1.EMPID=Table5.MainID
And Table1.UID=Table2.UID
Can you please suggest what would be the better approach to obtain the result.
TIA!!
try as below
| LOAD | |
| Date, | |
| EMPID, | |
| CID, | |
| UID | |
| FROM Table1; | |
| JOIN | |
| LOAD | |
| UID | |
| Fnumber, | |
| FID | |
| FROM Table2; | |
| JOIN | |
| LOAD | |
| FID, | |
| TID | |
| FROM Table4; | |
| JOIN | |
| LOAD | |
| TID, | |
| Text | |
| From Table3 |
try as below
| LOAD | |
| Date, | |
| EMPID, | |
| CID, | |
| UID | |
| FROM Table1; | |
| JOIN | |
| LOAD | |
| UID | |
| Fnumber, | |
| FID | |
| FROM Table2; | |
| JOIN | |
| LOAD | |
| FID, | |
| TID | |
| FROM Table4; | |
| JOIN | |
| LOAD | |
| TID, | |
| Text | |
| From Table3 |
Hello vinieme12
Thanks for the reply and sorry for the delay in getting back.
This looks good, can you also please let me know how do i write my conditions mentioned by following your suggested way?
this is how your data tables will join; which is based on the conditions specified, i've highlighted the key fields for reference. you don't need to write the conditions separately
we are joining table 1 and table on UID
And Table1.UID=Table2.UID
Table2 to table 4 on FID
And Table2.FID=Table4.FID
and Table 4 to table 3 on TID
And Table4.TID=Table3.TID
these are for Joins not conditions of load
Thanks Vineeth,
Your solution works perfectly for me.