Matrix Filter

s imam 21 Reputation points
2022-02-15T16:26:56.06+00:00

Hi,

I need help in filtering the matrix. My data source has 8 years of data because I am comparing the last three of data. But I want to display only five years.

I tried to filter the matrix

my filter

Expression : Left(Fields!Years.Value,4)
Operator <=
Value : Left(Fields!Years.Value,4) - 5

Data type of year varchar(10)

Any help would be appreciated

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,918 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Joyzhao-MSFT 15,581 Reputation points
    2022-02-16T02:02:04.767+00:00

    Hi @s imam ,
    The first case is that you only need five years of data in the entire report, and you can use a where statement to filter when you create a dataset query.

    In the second case, you need eight years of data in your report, but you need to select single or multiple years of data at different times, and you could create parameters in this case.

    • Create a second dataset that can be queried as Select distinct Year From TableName
    • In the first dataset, add the Where clause: Where @Year=Year, an parameter @Year was created.
    • Assign values to parameters through the second dataset.
    • View the report rendering at this time.

    If your issue is not resolved, please provide more details.
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.