SSRS report calculate field - reporting-services

I have a requirement of creating an ssrs report that needs to be showed in a matrix in this format
Dataset includes the following fields
year, month, values, account name
report format is something like this:
current month | month ( last year)| difference in %
account name
how do I calculate field for month of previous year? because SSRs does not have case or where logic inbuilt?

If you are doing this in your dataset you can do
DATEADD(YY,-1,COLUMN)
This will change your date a year back.
If you want to do this in the Report Side You can create a new column and create a calculated field and use:
=DateAdd(DateInterval.Year,-1,ColumnName)
Same Effect

Related

Date is automatically resetting to beginning once it reaches the month end in SSRS

I have a matrix table which contains a day(currentdate value) as row group and month as a column group. The column group has two child columns one contains the data represents a value which falls on that particular day of that month and another is a running value. like wise the column values represents for current and previous month. Now the problem is for the month which doesn't have the date 31 contains the data which actually belongs to the particular months start date data. to understand how the data is populating for that particular row I added a column of date field. it shows the start date of the month.
I would like to know how to avoid this automatic data resetting.
Sample image of the issue

drillthrough month and year grouping error

I used the query below to create a parameter for a drillthrough in my ssrs.
SELECT DISTINCT month([OrderDate])AS 'Month',
FROM cob_adhoc
where datepart(MONTH,[OrderDate]) = #month
group by year([OrderDate]), month([OrderDate])
in my report, i have columns for year and month and other data. The month column has the textbox action to lead to the selected month in another table.
My problem is say someone clicks June in 2014, it brings out data from june from all the years on the table and not the year in the report column.
You will need to create a calculated field in your dataset with the combined values of
CalcMonthYear=CSTR(Fields!Month.Value) + CSTR(Fields!Year.Value)
Then in you label's action don't go to [Month] instead go to [CalcMonthYear]

Partial sum in SSRS 2008 R2

I've a column with values for each month of the year.
Then in parameters of my report i would be able to set the month.
SSRS should return this column with values for each month of the year (like if there's no parameter) but the sum at the bottom of this column should return the sum of the value from the beginning of the year to the selected month.
Is it possible?
Yes. If I'm understanding correctly, you want something like the image below:
Assuming your MonthYear column is a DateTime and your month parameter is an Integer, you can use an expression like the following to conditionally sum the total based on the parameter value:
=Sum(IIf(Month(Fields!MonthYear.Value) <= Parameters!Month.Value, Fields!Value.Value, 0))

SSRS Line Chart X-Axis group by Month

everyone. For the life of me I cannot figure out why the X-Axis is pulling 2 dates in each month when I want it to group by each month. In the Values I have:
Value Field =RunningValue(Fields!new_actualsalesfromsplit.Value, Sum, "Chart1_SeriesGroup")
Category Field: =Fields!closedate.Value
Category Groups =Month(Fields!closedate.Value)
Group On =Month(Fields!closedate.Value)
Series Group by ["salesperson']
The chart should have a line for each sales person, and each month should be a cumulative representation of the sales by that person. Thanks for any help.
Set the category field to "=Month(Fields!closedate.Value)", or something similar that will net the results you need. Right now, even though you're grouping by month, you're still telling SSRS to use the atomic data for your X axis, so that's what it's doing.
It may make your task simpler to just add a Calculated Field to your dataset - open the dataset properties window, go to the fields tab, and click "add". Set that field to your month value, use it for grouping and your X axis.

Current Vs Last Year SSRS Reporting

I am new in SSRS Reporting, I face a problem in sales report.I want to do a report like this
Team Current Last
A 1000 200
B 2000 6000
How can I do this in expression
First from query get all records for current & last year like Team,Sale,Year and then at report level do column grouping at Table and Group On Year, then include column that you want to display in your Report.