Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New Contributor III

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
Highlighted

Re: Concatenate two tables with differentiate the date range

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
Highlighted

Re: Concatenate two tables with differentiate the date range

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

Highlighted
New Contributor III

Re: Concatenate two tables with differentiate the date range

(SalesDate=2014 and WarrantyDate>=2015)

    

IDProductSales DateWarranty Date
4D20142016

Sales Date = 2014 with >=2015 Warranty Date

Warranty Date >= 2015 with 2014 Sales Date

Highlighted
Honored Contributor

Re: Concatenate two tables with differentiate the date range

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

Highlighted

Re: Concatenate two tables with differentiate the date range

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

Partner
Partner

Re: Concatenate two tables with differentiate the date range

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>