How do you group by multiple columns?

  • I have a report that lists the medications that a patient is on. But, for each medication, I also get the account number, name, dob repeated. I would like to group by those columns so, they only appear once at the top of the group. Any thoughts?

  • Hi,

    You can just group on the Medication if it's enough and then use the First() summary for the other values in you header / footer rows.

    Spiff

  • Pardon my ignorance but, I don't get it. I've attached a screen shot. Patient demographics in the first few columns and medications in last column. I'd like the demographic stuff to only appear once.

  • Apologies, read your explanation wrong.

    You don't really want to group on multiple columns, just group on whatever is the unique identifier for the patient, e.g. the Account Number.

    So add a parent group (right click Details in the Row Groups box). Group on the identifier for the patient and make sure to check the "Add group header" checkbox.

    You can then just add the other details in that group header row and they they will only display once per group. In the details row below just add the medication. This will list each medication for the patient.

    HTH

  • I added a group but, can't move the other fields to the group row. If I add each row in the Group Properties, it groups by each field. I have this set up as Stepped. Should it be Blocked?

  • Are you using the wizards for this?

  • No.

  • This is what you should be aiming for.

  • I'm using Visual Studio.

  • Right click the group (under 'Row Groups'), on 'General' add 'Group Expressions' and add one for each field, selecting the necessary field from your dataset each time.

    Then just add the fields (e.g right click details row, insert row)

  • Got it. Thanx.

Viewing 11 posts - 1 through 10 (of 10 total)

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