Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

IntervalMatch multiple key

Howdy,

I face up a problem connecting two tables with IntervalMatch:

Grades:

load * inline

[

min, max, grade, subject

0, 20, fail, math

20, 50, bad, math

50, 80, good, math

80, 100, perfect, math

0, 20, fail, history

20, 50, bad, history

50, 100, good, history

];

Marks:

load * inline

[

mark, student, sub

6, steve, math

49, ema, math

77, cate, math

25, joe, math

98, hary, history

];

Data:

IntervalMatch (mark, sub) load

min, max, subject

resident Grades;

How to connect correctly Grades and Marks tables in IntervalMatch that I could get the information like this:

6, steve, math, fail

49, ema, math, bad

77, cate, math, good

25, joe, math, bad

98, hary, history, good

Thank you in advance!

1 Solution

Accepted Solutions
its_anandrjs

Try to load the table this way ans rename the sub field as subject in the Marks table thats why interval match not works

Marks:

LOAD *,sub as subject;

load * inline

[

mark, student, sub

6, steve, math

49, ema, math

77, cate, math

25, joe, math

98, hary, history

];

Grades:

load * inline

[

min, max, grade, subject

0, 20, fail, math

20, 50, bad, math

50, 80, good, math

80, 100, perfect, math

0, 20, fail, history

20, 50, bad, history

50, 100, good, history

];

Inner Join

Data:

IntervalMatch (mark, subject) load min, max, subject resident Grades;

Join(Marks)

LOAD * Resident Grades;

DROP Table Grades;

DROP Field sub;

You get this output:-

IntervalMatchOP.png

View solution in original post

2 Replies
its_anandrjs

Try to load the table this way ans rename the sub field as subject in the Marks table thats why interval match not works

Marks:

LOAD *,sub as subject;

load * inline

[

mark, student, sub

6, steve, math

49, ema, math

77, cate, math

25, joe, math

98, hary, history

];

Grades:

load * inline

[

min, max, grade, subject

0, 20, fail, math

20, 50, bad, math

50, 80, good, math

80, 100, perfect, math

0, 20, fail, history

20, 50, bad, history

50, 100, good, history

];

Inner Join

Data:

IntervalMatch (mark, subject) load min, max, subject resident Grades;

Join(Marks)

LOAD * Resident Grades;

DROP Table Grades;

DROP Field sub;

You get this output:-

IntervalMatchOP.png

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

It worked perfectly!