Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

morganaaron
Valued Contributor

IntervalMatch Multiplying Records

Hi all,

I'm currently trying to use an IntervalMatch to join Start/End Timestamps to Event timestamps. The 'Session' table has the SessionID, UserName, DocumentName and SessionStart and SessionEnd timestamps.

My task table has a number of distinct fields, but also contains the DocumentName and UserName, as well as the Event timestamp.

I'm attempting to use an IntervalMatch table to simply return the start and end points of the session that each task belonged to, but due to having users/documents this has to be unique to each user on each document.

I was using:

IntervalMatch(Timestamp, UserName, DocumentName)
Load
SessionStart,
SessionEnd
Resident Sessions;

Which works fine unless the User has multiple sessions, where it then loads a record of each event against every possible start/end for that user, regardless of the fact that the task didn't exist in that timeframe.

The tables above are joining on User and DocumentName, is it the join(s) that's causing the issue? I've tried using a composite key but it caused the same errors.

Thanks!

Tags (1)
1 Solution

Accepted Solutions

Re: IntervalMatch Multiplying Records

Try adding the fields that should be used for matching the intervals too:


IntervalMatch(Timestamp, UserName, DocumentName)
Load
SessionStart,
SessionEnd,

UserName,

DocumentName
Resident Sessions;


Look up the IntervalMatch (Extended Syntax) entry in the Qlikview help file for more information.




talk is cheap, supply exceeds demand
2 Replies

Re: IntervalMatch Multiplying Records

Try adding the fields that should be used for matching the intervals too:


IntervalMatch(Timestamp, UserName, DocumentName)
Load
SessionStart,
SessionEnd,

UserName,

DocumentName
Resident Sessions;


Look up the IntervalMatch (Extended Syntax) entry in the Qlikview help file for more information.




talk is cheap, supply exceeds demand
morganaaron
Valued Contributor

Re: IntervalMatch Multiplying Records

Ah, knew it was simple...thanks Gysbert - I'd read it a few times, but had somehow missed the fact that Key was referenced at the end of the field load, blame it on lack of coffee..

Community Browser