3 Replies Latest reply: Dec 14, 2011 5:17 AM by Kjetil Kleppe RSS

    Crosstable (?)

    Kjetil Kleppe

      Hi,

      If I have a table like this:

      AccountNoAccountNameYearActualPeriod1ActualPeriod2ActualPeriod3….ActualPeriod12BudgetPeriod1BudgetPeriod2BudgetPeriod3….BudgetPeriod12
      10000Name12010145 00050 00070 000-40 000174 00060 00084 000-48 000
      10000Name12011200 000100 000-300 000200 000240 000120 000-360 000240 000


      Is it possible to get it like this by scritping:

      AccountNoAccountNameYearPeriodActualBudget
      10000Name120101145 000174 000
      10000Name12010250 00060 000
      10000Name12010370 00084 000
      10000Name1201012-40 000-48 000
      10000Name120111200 000240 000
      10000Name120112100 000120 000
      10000Name120113-300 000-360 000
      10000Name1201112200 000240 000
        • Crosstable (?)

          Hi,

           

          Yes you can.. You can either use transpose functionality of Qlikview or by using scripting.

           

          If you are using scripting, then it should be something like this;

           

          Load AccountNo,

                  AccountName,

                 Year,

                  '1' as Period,

                   ActualPeriod1 as Actual,

                   BudgetPeriod1 as Budget

          from xxxx;

           

          concatenate

           

          Load AccountNo,

                  AccountName,

                 Year,

                  '2' as Period,

                   ActualPeriod1 as Actual,

                   BudgetPeriod1 as Budget

          from xxxx;

           

          concatenate

          ...

          ...

          ...

           

          so on...

           

          BR

           

          Omer

          • Re: Crosstable (?)

            Hi,

            This can be done by cross table.Please see the attached files for details

            I hope this will help You

             

            Thanks

            Vivek

            • Crosstable (?)
              Kjetil Kleppe

              Thanks for quick response and answers!