Search code examples
reporting-servicesssrs-2012

SSRS Matrix is giving me the strange result


I have written a simple query as you can see below.

select distinct 
   g.EnglishCountryRegionName,
   g.City,
   f.SalesAmount
From [dbo].[DimGeography] g
inner join FactInternetSales f on f.SalesTerritoryKey = g.SalesTerritoryKey

It gives me the following result

enter image description here

After this I created the matrix where in row grouping I put EnglishCountryRegionName and on column grouping, I put the city as you can see below

enter image description here

On the column grouping, I use the following expression

=iif(left(Fields!City.Value,1)="A",Fields!City.Value,nothing)

It gives me the cities that start with the letter "A" but at the end it also gives me the one extra column that is starting with the letter "B" as you can see below.

enter image description here

Do you know why I am getting the last highlighted column? Your help will be appreciated!


Solution

  • You have to use the same expression both in the grouping and display value. Change the city value in your tablix with the group expression.

    enter image description here

    enter image description here