1 Reply Latest reply: Dec 22, 2012 1:30 PM by Gysbert Wassenaar RSS

    Row Value to Data Table

      HI

       

      I have following table with below data

       

      tableA:

       

      Product
      Stock Dead Level
      From Date
      Todate
      Status
      A201 jan 2012 30 jun 2012Green
      B301 mar 2012 31 dec 2012Yellow
      ......................

       

      and i am looking for QV script which convert this table into following table

       

      tableB:

       

      Date
      Product
      Stock Dead Level
      Status
      1 jan 2012A20Green
      2 jan 2012A20Green
      ................
      ....................
      30 junA20Green
      1 mar 2012B30Yellow
      2 mar 2012B30Yellow
      ..................
      31 dec 2012B......Yellow

       

      regards

        • Re: Row Value to Data Table
          Gysbert Wassenaar

          T1:

          LOAD Product, [Stock Dead Level],

                       date#([From Date],'D MMM YYYY') as [From Date],

                       date#([Todate],'D MMM YYYY') as [Todate], 

                       Status INLINE [

              Product, Stock Dead Level, From Date, Todate, Status

              A, 20, 1 jan 2012, 30 jun 2012, Green

              B, 30, 1 mar 2012, 31 dec 2012, Yellow

          ];

           

           

          T2:

          load *, date([From Date]+IterNo()-1,'D MMM YYYY') as Date

          Resident T1 While [From Date]+IterNo()-1<=Todate;

           

          drop table T1;

           

          See attached qvw