Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to Concatenate two tables with differentiate the date range.?
Concatenate 2014 SalesDate with those having 2015 WarrantyDate
Sales Date = 2014 with >=2015 Warranty Date
Warranty Date >= 2015 with 2014 Sales Date
Table1:
ID | Product | Sales Date |
1 | A | 2014 |
2 | B | 2013 |
3 | C | 2015 |
4 | D | 2014 |
5 | E | 2012 |
6 | F | 2015 |
7 | G | 2017 |
8 | H | 2015 |
9 | I | 2013 |
Table2:
ID | Product | Warranty Date |
1 | A | 2014 |
2 | B | 2014 |
3 | C | 2015 |
4 | D | 2016 |
5 | E | 2014 |
6 | F | 2015 |
7 | G | 2017 |
8 | H | 2016 |
9 | I | 2015 |
May be like this..
T1:
LOAD * INLINE [
ID, Product, Sales Date
1, A, 2014
2, B, 2013
3, C, 2015
4, D, 2014
5, E, 2012
6, F, 2015
7, G, 2017
8, H, 2015
9, I, 2013
] ;
Left Join
LOAD * INLINE [
ID, Product, Warranty Date
1, A, 2014
2, B, 2014
3, C, 2015
4, D, 2016
5, E, 2014
6, F, 2015
7, G, 2017
8, H, 2016
9, I, 2015
];
NoConcatenate
T2:
LOAD * Resident T1 Where [Sales Date]=2014 and [Warranty Date]>=2015;
DROP Table T1;
Do you want to concatenate or Join? Would you be able to provide desired output from the sample you provided?
(SalesDate=2014 and WarrantyDate>=2015)
ID | Product | Sales Date | Warranty Date |
4 | D | 2014 | 2016 |
Sales Date = 2014 with >=2015 Warranty Date
Warranty Date >= 2015 with 2014 Sales Date
Hi Kirubakaran,
Maybe so?
Table1:
LOAD*Inline
[ID, Product, Sales Date
1, A, 2014
2, B, 2013
3, C, 2015
4, D, 2014
5, E, 2012
6, F, 2015
7, G, 2017
8, H, 2015
9, I, 2013];
Left Join
LOAD*Inline
[ID, Product, Warranty Date
1, A, 2014
2, B, 2014
3, C, 2015
4, D, 2016
5, E, 2014
6, F, 2015
7, G, 2017
8, H, 2016
9, I, 2015];
Perhaps there would be enough join only over field ID, if it is key.
Regards,
Andrey
May be like this..
T1:
LOAD * INLINE [
ID, Product, Sales Date
1, A, 2014
2, B, 2013
3, C, 2015
4, D, 2014
5, E, 2012
6, F, 2015
7, G, 2017
8, H, 2015
9, I, 2013
] ;
Left Join
LOAD * INLINE [
ID, Product, Warranty Date
1, A, 2014
2, B, 2014
3, C, 2015
4, D, 2016
5, E, 2014
6, F, 2015
7, G, 2017
8, H, 2016
9, I, 2015
];
NoConcatenate
T2:
LOAD * Resident T1 Where [Sales Date]=2014 and [Warranty Date]>=2015;
DROP Table T1;
Hi,
Try this:
Table 1:
Load Autonumber(ID_Product) as Key,
ID as Table1ID,
Product as Table1Product,
[Sales Date]
Resident <Source>
Left Join (Table 1)
Load Autonumber(ID_Product) as Key,
ID as Table2ID,
Product as Table2Product,
[Warranty Date]
Resident <Source2>