Question : Reporting Services - Comparison Report

Hello Experts,
I am a newly beginner SSRS developer and want to create a comparison report.
My dataset contains the following columns:
ClassID --> Product class ID
Year --> Product Year
WeekOfYear --> indicates week of the retail transaction date
SatisMiktari --> SalesQuantity

My purpose is to create a report that contains the following 3 columns:
ClassID
SatisMiktari
WeekComparison (A calculated columns that compares previous week and the last week of the sum of SalesQuantity)

How can I do this?
Any help is appreciated..
Regards

Answer : Reporting Services - Comparison Report

See if something like this works for you, I got the displayed output in the following test.

I created a query with an additional computed column to have the max week available because RS doesn't like nesting aggrigates.

select ClassID, Year, WeekOfYear, SatisMiktari, max(WeekOfYear) over () AS MaxWeek
from yourTable

then I did a simple table, grouped by ClassID, and used these two expressions to get the right values in the other 2 columns:
=Sum(IIF(Fields!WeekOfYear.Value=Fields!MaxWeek.Value,Fields!SatisMiktari.Value,0))
=Sum(IIF(Fields!WeekOfYear.Value=Fields!MaxWeek.Value,Fields!SatisMiktari.Value,0)) -
Sum(IIF(Fields!WeekOfYear.Value=Fields!MaxWeek.Value-1,Fields!SatisMiktari.Value,0))
 
 
Random Solutions  
 
programming4us programming4us