Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
=============================================
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
======================================================
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;
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;
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.
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;
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.