Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
oddgeir
Contributor III
Contributor III

Does interval match require adjacent table? (Solved - Join issue)

Does interval match require the table to be present immediately before in load script?

At least Qlik seems to be confused if it is not there. 

Below is illustration of two examples

1) Working example (Period table present immediately before IntervalMatch)
2) Failed example (The random table placed immediately before Intervalmatch)

 

1) Working example (Period table present immediately before IntervalMatch)

=============================================

RightMatch modellingRightMatch modelling

Working:
Load * Inline [
Date , Hours, WorkedName
07.01.2022 , 40 , Worker A
07.02.2022 , 40 , Worker A
];

AnotherTable:
Load * Inline [
A,B
x,y
p,d
];

Period:
Load * Inline [
From , To , Period
01.01.2020 , 01.03.2022 , 1
01.03.2022 , 01.01.2025 , 2
];

Left Join (Working)
Inner Join IntervalMatch ( Date )
LOAD From, To
Resident Period;

 

 

 

2) Failed example

======================================================

MatchFailModellingMatchFailModelling

Working:
Load * Inline [
Date , Hours, WorkedName
07.01.2022 , 40 , Worker A
07.02.2022 , 40 , Worker A
];

Period:
Load * Inline [
From , To , Period
01.01.2020 , 01.03.2022 , 1
01.03.2022 , 01.01.2025 , 2
];

AnotherTable:
Load * Inline [
A,B
x,y
p,d
];

Left Join (Working)
Inner Join IntervalMatch ( Date )
LOAD From, To
Resident Period;

 

 

 

Labels (1)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

 

It's becouse you are using a Left Join (Working) and Inner Join IntervalMatch ( Date ).

 

The Left Join (Working) make a join with Working 

The Inner Join make a join with previous table

 

I think the good script is :

 

Working:
Load * Inline [
Date , Hours, WorkedName
07.01.2022 , 40 , Worker A
07.02.2022 , 40 , Worker A
];

Period:
Load * Inline [
From , To , Period
01.01.2020 , 01.03.2022 , 1
01.03.2022 , 01.01.2025 , 2
];

AnotherTable:
Load * Inline [
A,B
x,y
p,d
];

Left Join (Period)
IntervalMatch ( Date )
LOAD From, To
Resident Period;

 

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

3 Replies
hic
Former Employee
Former Employee

No, the position of the tables shouldn't matter, as long as they're before the IntervalMatch.

I suggest you check your script again: It (incorrectly) contains TWO joins, where one of them refers to previous table:

"Left Join (Working) Inner Join IntervalMatch"

And - you don't need the join at all.

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

 

It's becouse you are using a Left Join (Working) and Inner Join IntervalMatch ( Date ).

 

The Left Join (Working) make a join with Working 

The Inner Join make a join with previous table

 

I think the good script is :

 

Working:
Load * Inline [
Date , Hours, WorkedName
07.01.2022 , 40 , Worker A
07.02.2022 , 40 , Worker A
];

Period:
Load * Inline [
From , To , Period
01.01.2020 , 01.03.2022 , 1
01.03.2022 , 01.01.2025 , 2
];

AnotherTable:
Load * Inline [
A,B
x,y
p,d
];

Left Join (Period)
IntervalMatch ( Date )
LOAD From, To
Resident Period;

 

Help users find answers! Don't forget to mark a solution that worked for you!
oddgeir
Contributor III
Contributor III
Author

Thanks a lot (both of you) for pointing me in right direction for my issue. 

I guess this is something survived from a previous example on Internet which worked for the purpose, and I just haven't dug into the issues of different joins before moving on.