1 Reply Latest reply: Jul 26, 2012 11:32 AM by Stefan Wühl RSS

    IntervalMatch: how to keep relation?

      Hello, consider the following:

       

      myInterval:

      Load * inline [begin,end,range

      0,10,a

      10,20,b

      20,30,c

      30,40,d];

       

       

      Results:

      LOAD

           "SID_X",

           "SID_Y",

           "SID_Z",

           "value";

      SQL SELECT *

      FROM vw_fact;

       

       

      What i would like is to get a new field that is the interval matching "value".

       

      I have tried using:

      IntervalMatch (value) load range  resident myInterval;

       

      But that creates my interval-range-field as a data island and i loose all my relations and so I cannot use my range-field as dimension on my X-axis with desired results. Any ideas?

       

      thank you

        • Re: IntervalMatch: how to keep relation?
          Stefan Wühl

          intervalmatch (matchfield) (loadstatement | selectstatement )

           

          matchfield is the field containing the discrete numeric values to be linked to intervals.

          loadstatement or selectstatement must result in a two-column table, where the first field contains the lower limit of each interval and the second field contains the upper limit of each interval. The intervals are always closed, i.e. the end points are included in the interval. Non-numeric limits render the interval to be disregarded (undefined) while NULL limits extend the interval indefinitely (unlimited).

           

          So I think you should write your intervalmatch load statement like:

           

          IntervalMatch (value) load begin, end  resident myInterval;

           

          (You might consider changing your intervals to non-overlapping, too)

           

          Regards,

          Stefan