Results 1 to 1 of 1

Thread: UNPIVOT crosstab sheet using SQL and get count of items.

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    25
    Rep Power
    0

    UNPIVOT crosstab sheet using SQL and get count of items.

    hi,

    i am trying to pull in a table from an external workbook into a ADO recordset and unpivot all the columns (approx 28 columns) starting with "Global" in their names and in the next column list their items and also their counts.

    i have attached a sample workbook which shows how i am currently doing it manually to create the table in the Output sheet from the Data sheet table which is actually the table from the input file.

    the counts are to be based on the ItemCreationDate column and any item which was created >=2015 shall be counted in a column called "New". Similarly, any item which was created <2015, shall be counted in a column called "Old". then i am taking a % of each item found in that Global column from that Global column total. the Index column is just a New/Old calculation.

    i dont know how to form the appropriate SQL query to do the unpivoting of each Global column and counting of their items. i hope the sample workbook shall make it clear.
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 04-07-2014, 02:44 PM
  2. Replies: 14
    Last Post: 06-27-2013, 10:57 AM
  3. Replies: 1
    Last Post: 12-04-2012, 05:30 PM
  4. Pivot Table Count No of Items per Category
    By Howardc in forum Excel Help
    Replies: 2
    Last Post: 07-04-2012, 10:49 PM
  5. Replies: 2
    Last Post: 11-17-2011, 07:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •