Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am having trouble getting my IntervalMatch function to work properly. I have posted my script below.
My end goal is to join the %SessionKey% from the Actions table to the Sessions table. I am trying to do this by first matching the Action Timestamp to the correct Session_Start and Session_End Interval. I need to add a key to the IntervalMatch in order to make the records more unique, which is why %IntervalKey_Actions% and %IntervalKey_Sessions% were created. Once the correct timestamp and key are associated on the Sessions table I want to then left join in the %SessionKey%. When I run my script below I get two synthetic tables. Any help on how to solve this would be appreciated. Thanks!
Actions:
LOAD
tmpDate&'-'&UPPER([Action Document])&'-'&UPPER([Action User]) as %IntervalKey_Actions%,
[Action Timestamp],
%SessionKey%
Resident tmp2_Actions;
Drop table tmp2_Actions;
Sessions:
LOAD
Session_Date&'-'&UPPER(Document_Name)&'-'&UPPER(UserId) as %IntervalKey_Sessions%,
Session_Start,
Session_End
Resident tmpSessions;
IntervalMatch:
Intervalmatch([Action Timestamp],%IntervalKey_Actions%)
Load Session_Start, Session_End, %IntervalKey_Sessions% as %IntervalKey_Actions%
Resident tmpSessions;
Drop Table tmpSessions;
This was an oversight on my part. I had two keys in one table which was causing duplication of records on the Session table after the IntervalMatch.
please post some sample data and your expected result
thanks
regards
Marco
This was an oversight on my part. I had two keys in one table which was causing duplication of records on the Session table after the IntervalMatch.