How do I aggregate rows into a single row?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Connelly
    New Member
    • Jan 2011
    • 103

    #1

    How do I aggregate rows into a single row?

    I have an SSRS matrix report that has months as the columns and accounts as the row. For the Month of May, Account A might have three different activities(deta ils fields) that would list the Account 3 times and each of the activities. What I would like to do is group by Account and in the Details Field for the Month of May display the 3 Activities. However, when I group by Account, the details filed only displays one activity and not all three. Any help would be appreciated.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I'm having trouble understanding what you mean. Some sample data and results would be helpful.

    Comment

    • Brian Connelly
      New Member
      • Jan 2011
      • 103

      #3
      THe matrix looks something like this:
      Acount Name May June July Aug
      Acct1 sale sale sale

      Acct2 sale sale

      Acct1 review

      When I group by the Account it would look like this:
      Acount Name May June July Aug
      Acct1 sale sale sale

      Acct2 sale sale
      As you see I lost the review.
      I would like it to look like this:
      Acount Name May June July Aug
      Acct1 sale sale sale
      review

      Acct2 sale sale


      I hope this helps explain.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Not particularly enlightening. What is this review row? A screenshot would help.

        Comment

        • Brian Connelly
          New Member
          • Jan 2011
          • 103

          #5
          Code:
          <table border="1">
            <tr>
              <th>Account</th>
              <th>May</th>
          <th>June</th>
          <th>July</th>
          
            </tr>
            <tr>
              <td>Acct1</td>
              <td>Sale</td>
              <td>""</td>
              <td>Sale</td>
          
            </tr>
            <tr>
               <td>Acct2</td>
              <td>Sale</td>
              <td> Review</td>
          <td>Sale</td>
          
            </tr>
          <td>Acct1</td>
              <td>Review</td>
              <td> Sale</td>
          <td>""</td>
            </tr>
          </table>
          
          <table border="1">
            <tr>
              <th>Account</th>
              <th>May</th>
          <th>June</th>
          <th>July</th>
          
            </tr>
            <tr>
              <td>Acct1</td>
              <td>Sale </br> Review</td>
              <td>Sale</td>
              <td>Sale</td>
          
            </tr>
            <tr>
               <td>Acct2</td>
              <td>Sale</td>
              <td> Review</td>
          <td>Sale</td>
          
            </tr>
            </tr>
          </table>

          Comment

          • Brian Connelly
            New Member
            • Jan 2011
            • 103

            #6
            Sorry, wont allow me to upload a screen shot. However the above code displays two tables, the first being how it looks and the second is what it should look like.

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              You said you did a group by in SSRS and it got rid of the review row? That shouldn't happen, a group by doesn't get rid of rows. Something else is going on. All it should do is bring the rows with the same group together. Unless the review row is actually some sort of aggregate row. Check the group header and footer. What is the record source?

              Comment

              • Brian Connelly
                New Member
                • Jan 2011
                • 103

                #8
                I believe it was a problem with doing it with FetchXML. I moved to query the DB and was able to get the results.

                Comment

                Working...