Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Concatenate two tables with differentiate the date range

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:

  

IDProductSales Date
1A2014
2B2013
3C2015
4D2014
5E2012
6F2015
7G2017
8H2015
9I2013

Table2:

  

IDProductWarranty Date
1A2014
2B2014
3C2015
4D2016
5E2014
6F2015
7G2017
8H2016
9I2015
1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

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;

View solution in original post

5 Replies
sunny_talwar

Do you want to concatenate or Join? Would you be able to provide desired output from the sample you provided?

Anonymous
Not applicable
Author

(SalesDate=2014 and WarrantyDate>=2015)

    

IDProductSales DateWarranty Date
4D20142016

Sales Date = 2014 with >=2015 Warranty Date

Warranty Date >= 2015 with 2014 Sales Date

ahaahaaha
Partner - Master
Partner - Master

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

settu_periasamy
Master III
Master III

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;

Anonymous
Not applicable
Author

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>