Union ALl

  • Hi

      I have 2 select statement with Union All . I want to show their separate Sub Totals. Can this be done. Can the data of 2 select statements be shown in different Matrix in SSRS.

    Thanks

  • jagjitsingh - Thursday, November 9, 2017 10:07 AM

    Hi

      I have 2 select statement with Union All . I want to show their separate Sub Totals. Can this be done. Can the data of 2 select statements be shown in different Matrix in SSRS.

    Thanks

    Can you provide some more details please?
    😎

  • I have to agree with Steve, this is quite vague.

    If, however, you need to treat the data from 2 separate tables separately, then don't UNION (ALL) them; then you have 2 datasets. If, for some reason unknown to the rest of us, you have(?) to UNION your data, add a column that denotes the source table. As you're using a UNION ALL, you're not eliminating duplications across the 2 tables anyway.
    SELECT YourColumns, 'FirstTable' AS SourceTable
    FROM FirstTable
    UNION ALL
    SELECT YourColumns, 'SecondTable' AS SourceTable
    FROM SecondTable;

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

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

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