Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to interrelate two tables with dates ?

Hi everyone,

I have an issue in Qlikview and don't know how to proceed.

I have 2 tables in a database : Table1 (train routing) & Table2 (season)

In table1 we have rows like :

  • departure_station (ex: Paris), arrival_station (ex: London), departure_time (ex 24/12/2014 10:00), arrival_time (25/12/2014 11:00)

In table2 we have rows like :

  • season_description (ex WINTER 2014), date_begin (ex 20/12/2014 00:00), date_end (ex 20/03/2015 00:00)

In my Qlikview doc, I have load the two tables like :

A:

LOAD Dep_station, Arr_station, dep_time, arr_time, Date(Floor(Date(dep_time,'DD/MM/YYYY'))) as DateUnique ;

SQL SELECT *

FROM "Table1"

WHERE dep_time>= '01/01/2012';


B:

LOAD DISTINCT Season_DESCRIPTION, floor(date_BEGIN) as S_BEGIN, floor(date_END) as S_END

;

SQL SELECT * FROM Table2 WHERE date_BEGIN>= '01/01/2011';

In the graphic view I just want a table with all information of table A and a filter so that when I choose a season in B (ex: Winter 2014), it filters all rows in A where depature_time is between the date_begin and date_end of the season...

And I don't know how to interrelate these 2 tables ? In the script ? In the graphic view ?

Thank you in advance for your help.

My bests,

Quy Thanh

1 Solution

Accepted Solutions

Re: How to interrelate two tables with dates ?

Hi Quy,

I upload an example using intervalmatch, hope this helps.

2 Replies

Re: How to interrelate two tables with dates ?

Hi Quy,

I upload an example using intervalmatch, hope this helps.

Not applicable

Re: How to interrelate two tables with dates ?

Thank you so much

I've finaly did it; I had some issues with qualify / unqualify to recognize the right fields but It's OK now.

Thanks again !

Community Browser