According to your script above, the following should return what you want. IntervalMatch accepts as many keys needed (the type in this case) so the range could be identified.
fact:load * inline [id, type, weigh 1047, normal, 0.72025, express, 0.31082, normal, 1.82093, express, 2.1]; weight_for_express:load * inline [start, end, weight_sort, type0.1, 0.5, 0.5, express0.6, 1, 1, express1.1, 1.5, 1.5, express1.6, 2, 5, express]; weight_for_normal:load * inline [start, end, weight_sort, type0.1, 1, 1, normal1.1, 2, 2, normal2.1, 3, 3, normal3.1, 4, 4, normal]; FactsWithWeights: // This table will be the final one.INTERVALMATCH (weigh, type) LOAD start, end, typeRESIDENT weight_for_express;LEFT JOIN LOAD *RESIDENT fact; DROP TABLE fact;DROP TABLE weight_for_express;
Check the above on how to use intervalmatch with a discrete value and a key.
Hope that helps.