Transpose Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TSGB
    New Member
    • Oct 2007
    • 14

    Transpose Report

    I need to do the following: If you look at a tabular regular report you'll see what I need but transposed. The title on the left in one single column and the data on its right side


    Like
    Record1 Record2 Record3 .......Record n
    Label1 . . . .
    Label 2 . . . .
    Label 3 . . . .
    . . . . .
    . . . . .
    . . . . .
    Label n . . . .

    Thanks Again,
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Looks to me you're looking for the Crosstable (or pivot) possibility.
    It will transform the contents of a field into a column header and the values for the rowheader will be placed underneath the proper column.
    This is however limited to one column for the header, but multiple rows headers are possible....

    Nic;o)

    Comment by TSGB was a "reported" post. Please use next time the [Reply] button...

    No crosstable doesn't work beacuse I have no vaules to summarize I just need to do a column report but with the titles only once in the report.

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      As stated, this will require a crosstable query and that has the problem that there will be a max of some 255 columns (or less). Indicating that you can have a max of 255 records.
      Before you can use a crosstable you would also need a tricked UNION to get the fields prepared to act as rows.

      Nic;o)

      Comment

      • TSGB
        New Member
        • Oct 2007
        • 14

        #4
        I don't understand. Can you explain it to me better please. Step by step what you would do. All my fields only have text.

        Thanks Again,


        Originally posted by nico5038
        As stated, this will require a crosstable query and that has the problem that there will be a max of some 255 columns (or less). Indicating that you can have a max of 255 records.
        Before you can use a crosstable you would also need a tricked UNION to get the fields prepared to act as rows.

        Nic;o)

        Comment

        • nico5038
          Recognized Expert Specialist
          • Nov 2006
          • 3080

          #5
          You would bneed a UNION query like:
          [code=sql]
          select PrimaryKeyField as ColumnHeader, 'fieldname1' as Rowheader, fieldname1 from tblYours
          UNION
          select PrimaryKeyField as ColumnHeader, 'fieldname2' as Rowheader, fieldname3 from tblYours
          UNION
          ..etc. for all fields (labels)
          [/code]
          This will generate a table with your primary keys, the labels (as typed) and the value of the field.
          Based on this query you can create a crosstable query with ColumnHeader as the columnheader and RowHeader as the Rowheader (your label) and finally the fieldvalue as Value.

          Nic;o)

          Comment

          Working...