1 Reply Latest reply: Apr 1, 2017 3:51 AM by Gysbert Wassenaar RSS

    How to use crosstable for the following ?

    gaurav gopale

      Hi

      I have the following  table

       

      StateJanSalesJanOrdCountFebSalesFebOrdCount
      A10000454700023
      B30000256700043

       

       

      Using crosstable can we get following table output

       

      StateMonthSalesOrderCount
      AJan1000045
      AFeb4700023
      BJan3000025
      BFeb6700043

       

      thanks in Advance

        • Re: How to use crosstable for the following ?
          Gysbert Wassenaar

          Perhaps like this:

           

          tempSales:

          CrossTable(Month,Sales)

          LOAD

               State,

               JanSales,

               FebSales,

          FROM

               ....source...

               ;

           

          tempOrderCount

          CrossTable(Month,OrderCount)

          LOAD

               State,

               JanOrdCount,

               FebOrdCount,

          FROM

               ....source...

               ;

           

          Result:

          NoConcatenate

          LOAD

               State,

               Left(Month,3) as Month

               Sales

          Resident

               tempSales

               ;

           

          Drop table tempSales;

           

          JOIN (Result)

           

          LOAD

               State,

               Left(Month,3) as Month

               OrderCount

          Resident

               tempOrderCount

               ;

           

          Drop table tempOrderCount;