Apply grouping over group

Malcolm van Staden 96 Reputation points
2020-10-06T11:25:49.033+00:00

Hi

I'm not entirely sure whether this is possible.

This is our dataset:
30258-screenshot-2020-10-06-130754.png

This is what our resulting report needs to look like:
30240-screenshot-2020-10-06-131044.png

We've been able to apply grouping via the farm_area_name field (see following image), but want it to be grouped further by applying grouping of product_name + reg_dosage + symbol over the grouped farm_area_name.

30412-screenshot-2020-10-06-131803.png

Any input or guidance would be greatly appreciated.

Thank you

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,910 questions
0 comments No comments
{count} votes

Accepted answer
  1. Malcolm van Staden 96 Reputation points
    2020-10-07T12:45:25.223+00:00

    Hi @ZoeHui-MSFT

    Thank you for your input.

    We were actually able to come up with a solution to this. I did not mention that we could modify the dataset using SQL - which is how we've been able to find a solution.

    We changed the dataset to include a combined group hash of the 3 columns (product_name + reg_dosage + symbol) per farm area by making use of FOR XML PATH('') to join the hashes together to form a unique group hash. This then allowed us to group on a combination of the grouped hash as well as the 3 columns. It is a rather convoluted solution, but it'll have to do for now.

    This is what our new dataset looks like:

    30658-screenshot-2020-10-07-141820.png

    We then further refined the dataset by grouping on the product_grouped_by_farm_area_combined_hash, product_name, symbol & reg_dosage before pulling it into SSRS (again using FOR XML PATH('') in order to group the farm_area names together):

    30595-screenshot-2020-10-07-142737.png

    Then within SSRS using the refined dataset we just group on the combined farm_area column (farm_areas) & our result is achieved:

    30703-screenshot-2020-10-07-144333.png


1 additional answer

Sort by: Most helpful
  1. ZoeHui-MSFT 36,111 Reputation points
    2020-10-07T02:13:57.327+00:00

    Hi @Malcolm van Staden ,

    I don't think it's possible to meet your requirement from SSRS side.

    We couldn't apply grouping of product_name + reg_dosage + symbol over the grouped farm_area_name.

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.