Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zenobendi
Contributor III
Contributor III

Intervalmatch problem with end points

Hello,

I was looking for some solution but no luck. Haven't found the case I'm struggling with so I decided to post it. I will apprecieate some help.

I need to connect an height interval with the product id. In fact I have many items with different heights (also with decimals, for example like 60.5, 151.8...) and I can't create an Interval function like this:


Altezza_articoli:
LOAD * inline
[
ART, H
ART1, 20
ART2, 70
ART3, 60.5
ART4, 150
ART6, 60
ART7, 60
ART5, 151.5
]
;

Classe_altezza:
LOAD * inline
[
Altezza_Min ,Altezza_Max, Classe_Altezza
0,30, 0-30
30.1,60, 31-60
60.1,80, 61-80
80.1,100, 81-100
100.1,120, 101-120
120.1,150, 121-150
150.1,900000000000, 151->
];


inner join
IntervalMatch(H)
load
Altezza_Min, Altezza_Max
resident Classe_altezza;

 

And also if I substitute the "." with "," like: 

Altezza_articoli:
LOAD * inline
[
ART, H
ART1, 20
ART2, 70
ART3, 60,5
ART4, 150
ART6, 60
ART7, 60
ART5, 151,5
]
;

Classe_altezza:
LOAD * inline
[
Altezza_Min ,Altezza_Max, Classe_Altezza
0,30, 0-30
30,1,60, 31-60
60,1,80, 61-80
80,1,100, 81-100
100,1,120, 101-120
120,1,150, 121-150
150,1,900000000000, 151->
];

inner join
IntervalMatch(H)
load
Altezza_Min, Altezza_Max
resident Classe_altezza;

It only create a connection between ART1 and the interval 0-30 (which is correct), but it doesn't create a connection with the others value.

The separator for decimals is ","

Thank you

1 Reply
chrismarlow
Specialist II
Specialist II

Hi,

I am not sure I follow what you are after, but I got the following table from the following script;

20201204_4.png

Altezza_articoli:
LOAD * inline
[
ART, H
ART1, 20
ART2, 70
ART3, 60.5
ART4, 150
ART6, 60
ART7, 60
ART5, 151.5
]
;

Classe_altezza:
LOAD * inline
[
Altezza_Min ,Altezza_Max, Classe_Altezza
0,30, 0-30
30.1,60, 31-60
60.1,80, 61-80
80.1,100, 81-100
100.1,120, 101-120
120.1,150, 121-150
150.1,900000000000, 151->
];


inner join (Altezza_articoli)
IntervalMatch(H)
load
Altezza_Min, Altezza_Max
resident Classe_altezza;

LEFT JOIN (Altezza_articoli)
load
	*
resident Classe_altezza;

DROP TABLE Classe_altezza;

I am also a little doubtful on your ranges having gaps, I think interval match would cope with them being contigious (otherwise where does 30.05 go?).

Cheers,

Chris.