Can i do this (pivot)

  • Im not even sure this is possible.

    I have a data set that is pulled into a excel spread sheet and pivoted as below.

    orders and values are group along the top for currency (GBP), Code (E), Group (Austin), Year(2010), Month (10) and split by sales date (row labels). obviously there are many different groups, codes, year, month which stretch along the top.

    im wanting to replicate this into a staging table, is this possible. i looked at pivot but it only seems to work with one grouping?

    all help appreciated

  • It's possible, take a look at this articles:

    Cross Tabs: Part 1[/url]

    Cross Tabs: Part 2[/url]

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • i had a look, im not sure if this will give me the ability to dybamicaly build the column groupings. or am i missing somthing - possible

  • I'm not sure what you need without DDL, sample data and expected results.

    However, those articles have the basic theory to pivot queries both static and dynamic.

    For more help, please read the article linked on my signature.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply