locked
Display total of values outside result set RRS feed

  • Question

  • I have a report which displays the top N(based on parameter) stores ranked by sales and partitioned by branch. I am using a stored procedure to get this dataset. In the report, I have the total sales for the top N stores displayed for each branch, but under that I also want to display the total sales for all other stores not in the top N for that branch as well as total for all stores in that branch. Is this possible?
    Friday, August 7, 2020 1:17 AM

All replies

  • Hi,

    Not seeing you dataset makes it hard to guess what you currently have. 

    I think this could be an suitable job for T-SQL in your stored procedure to get the sum of the (totalCount-N) stores that is sort reversely , and add a result of the total sum in to the dataset.

    In SSRS with VB expression it could be a hard job depends on you dataset style.

    Regards,

    Lukas


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    Friday, August 7, 2020 6:00 AM