Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
rubenmarin

Hi Quy,

I upload an example using intervalmatch, hope this helps.

View solution in original post

2 Replies
rubenmarin

Hi Quy,

I upload an example using intervalmatch, hope this helps.

Not applicable
Author

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 !