2 Replies Latest reply: Jul 31, 2014 8:15 AM by Sailee Kumawat RSS

    Filter and transpose data

      Hi,

      I have two tables. One with Date and associated values of sales. There is another table which has 2 columns :  CYDate,PYDate . I need to create new table with columns : CYDate, PYDate,CYValue,PYValue. I am finding it difficult to do the same qlikview. I need to do this at script level only for certain calculations. Can someone guide ?

       

      Souce table 1 :

      DateSales
      1/1/2014123
      1/2/2014124
      1/3/2014125
      1/4/2014123
      1/5/2014124
      1/6/2014124
      1/7/2014124
      1/8/2014124
      1/9/2014124
      1/10/2014125
      1/2/2013125
      1/3/2013125
      1/4/2013125
      1/5/2013125
      1/6/2013125
      1/7/2013125
      1/8/2013125
      1/9/2013125
      1/10/2013125
      1/11/2013126

       

      Source Table 2:

       

      CYDatePYDATE
      1/1/20141/2/2013
      1/2/20141/3/2013
      1/3/20141/4/2013
      1/4/20141/5/2013
      1/5/20141/6/2013
      1/6/20141/7/2013
      1/7/20141/8/2013
      1/8/20141/9/2013
      1/9/20141/10/2013
      1/10/20141/11/2013

       

      Required result :

       

      CYDateNPYDATECYSalesPYSales
      1/1/20141/2/2013123125
      1/2/20141/3/2013124125
      1/3/20141/4/2013125125
      1/4/20141/5/2013123125
      1/5/20141/6/2013124125
      1/6/20141/7/2013124125
      1/7/20141/8/2013124125
      1/8/20141/9/2013124125
      1/9/20141/10/2013124125
      1/10/20141/11/2013125126

       

      Thanks,

      Sailee