Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Gurus
I have following data
[Visit]:
LOAD * INLINE [
RepCode, VisitDate, PlanDate, CombDate
0928, 01.03.2018, , 01.03.2018
0928, , 02.03.2018, 02.03.2018
0928, 03.01.2018, 03.03.2018, 03.03.2018
0428, 01.03.2018, , 01.03.2018
0428, , 02.03.2018, 02.03.2018
0428, 03.01.2018, 03.03.2018, 03.03.2018
0933, 01.03.2018, , 01.03.2018
0933, , 02.03.2018, 02.03.2018
0933, 03.01.2018, 03.03.2018, 03.03.2018
];
[Calendar]:
LOAD * INLINE [
CalDate
01.03.2018
02.03.2018
03.03.2018
04.03.2018
];
and with this data i want a new table with records like followings
[Main]:
LOAD * INLINE [
RepCode, VisitDate1, PlanDate1, CombDate1
0428, 01.03.2018, , 01.03.2018
0428, , 02.03.2018, 02.03.2018
0428, 03.01.2018, 03.03.2018, 03.03.2018
0428, , , 04.03.2018
0933, 01.03.2018, , 01.03.2018
0933, , 02.03.2018, 02.03.2018
0933, 03.01.2018, 03.03.2018, 03.03.2018
0933, , , 04.03.2018
0928, 01.03.2018, , 01.03.2018
0928, , 02.03.2018, 02.03.2018
0928, 03.01.2018, 03.03.2018, 03.03.2018
0928, , , 04.03.2018
];
How to make a product of above two tables
[Visit]:
LOAD * INLINE [
RepCode, VisitDate, PlanDate, CombDate
0928, 01.03.2018, , 01.03.2018
0928, , 02.03.2018, 02.03.2018
0928, 03.01.2018, 03.03.2018, 03.03.2018
0428, 01.03.2018, , 01.03.2018
0428, , 02.03.2018, 02.03.2018
0428, 03.01.2018, 03.03.2018, 03.03.2018
0933, 01.03.2018, , 01.03.2018
0933, , 02.03.2018, 02.03.2018
0933, 03.01.2018, 03.03.2018, 03.03.2018
];
Join(Visit)
[Calendar]:
LOAD * INLINE [
CombDate
01.03.2018
02.03.2018
03.03.2018
04.03.2018
];
Thanks for the reply,
i got the following result by joining the
CombDate | PlanDate | RepCode | VisitDate |
01.03.2018 | 0428 | 01.03.2018 | |
01.03.2018 | 0928 | 01.03.2018 | |
01.03.2018 | 0933 | 01.03.2018 | |
02.03.2018 | 02.03.2018 | 0428 | |
02.03.2018 | 02.03.2018 | 0928 | |
02.03.2018 | 02.03.2018 | 0933 | |
03.03.2018 | 03.03.2018 | 0428 | 03.01.2018 |
03.03.2018 | 03.03.2018 | 0928 | 03.01.2018 |
03.03.2018 | 03.03.2018 | 0933 | 03.01.2018 |
04.03.2018 |
but how to get 04.03.2018 with all repcodes with plandate and visitdate blank
ie
CombDate | PlanDate | RepCode | VisitDate |
01.03.2018 | 0428 | 01.03.2018 | |
01.03.2018 | 0928 | 01.03.2018 | |
01.03.2018 | 0928 | 01.03.2018 | |
02.03.2018 | 02.03.2018 | 0428 | |
02.03.2018 | 02.03.2018 | 0928 | |
02.03.2018 | 02.03.2018 | 0933 | |
03.03.2018 | 03.03.2018 | 0428 | 03.01.2018 |
03.03.2018 | 03.03.2018 | 0928 | 03.01.2018 |
03.03.2018 | 03.03.2018 | 0933 | 03.01.2018 |
04.03.2018 | 0428 | ||
04.03.2018 | 0928 | ||
04.03.2018 | 0933 |
Thanks
Which field is common in both the tables?
Do you want cartesian join?
yes a cartesian join. for every RepCode vs CombDate
i see CombDate is common between them
Then he can probably outer join the tables