1 Reply Latest reply: Feb 13, 2012 1:03 PM by Stefan Wühl RSS

    Creating graphic based on data with valid during time intervals

      Hello,

       

      I've got a set of data which represent values which are valid over a certain time interval. I've created a sample and attached it to this post.

       

      So the data are:

      - Product

      - Valid from

      -Valid until

      - Value

       

      I'd like to create, based upon these data, a graphic which shows the values as a step-function on a time basis. So the line stays horizontal until the date "valid until" and then jumps (steps) towards the next value (same product, value according to the date mentioned in the corresponding "valid from"). Multiple products should be included in the graph at the same time.

       

      Thanks in advance for the advice !

        • Re: Creating graphic based on data with valid during time intervals
          Stefan Wühl

          You could use IntervalMatch for linking you slowly changing dimension to a calendar, like:

           

          Product:

          LOAD Product,

               [Valid from],

               [Valid to],

               Value

          FROM

          C:\Users\Stefan\Downloads\Sample_intervalgraph.xls

          (biff, embedded labels, table is Sheet1$);

           

          Calendar:

          LOAD

          Date(makedate(2010)+RecNo()-1) as Date

          autogenerate 365;

           

          IntervalMatch (Date) Load [Valid from], [Valid to] resident Product;

           

           

          Then just create a line chart with dimension Date and Product and as expression

          sum(Value)

           

          See also attached.

           

          An alternative is to create additional data records right in your product table using while statement.

           

          Stefan