Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IntervalMatch doesn't give expected results

I have 2 tables. The Team table shows team membership and the time interval when the member was part of the team (in the example, Maggie was part of team Steve during the 1st through 3rd month and then she switched to team Jerry from 4th through 6th month). The Sales table shows qty sold by team for specific month.

Team Table:

UserTeamStartEnd
MaggieA13
MaggieB46

Sales Table:

TeamMonthQty
Steve2200
Jerry2210
Steve5500
Jerry5510

I’m trying to figure out how many sales should be assigned to a rep based on the performance of the team that the sales rep belonged to at the time (this is really for bonus calculations).

In this example, Maggie should show the following:

UserMonthQty
Maggie2200
Maggie5510

Instead the script below gives me sum of sales for all teams over all periods. I can’t figure out whether I have a design / concept problem or syntax / how I use the IntervalMatch function. I’d appreciate any help.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Team link to Sales is made only on Team name. Generating an IntervalMatch table does not change that unless you use the IntervalMatch table to refine the link.

So...LEFT JOIN the IntervalMatch table to either the Sales or Team table.

LEFT JOIN (Team)

IntervalMatch (Month,Team)

Load

Start,
End,
Team

Resident Team;

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Team link to Sales is made only on Team name. Generating an IntervalMatch table does not change that unless you use the IntervalMatch table to refine the link.

So...LEFT JOIN the IntervalMatch table to either the Sales or Team table.

LEFT JOIN (Team)

IntervalMatch (Month,Team)

Load

Start,
End,
Team

Resident Team;

-Rob

http://masterssummit.com

http://robwunderlich.com

Anonymous
Not applicable
Author

Thanks Rob. Now that I've read it outloud it makes sense.

Brian