Reputation: 107
I need to create a report which would show sales by department by week day in the following format:
Department Mon Tue Wed Thu Fri Sat Sun
Dep1
Dep2
Dep3
Currently data is in list format and my current query is
SELECT
sales_reporting_view.department_name
,sales_reporting_view.created_date
,sales_reporting_view.sales_spti
FROM
sales_reporting_view
I have looked around and one of the solutions is to use Pivot function but I failed to make it work for my example as I'm quiet new to SSRS. Any suggestions would be appreciated.
Upvotes: 0
Views: 1154
Reputation: 1492
You could PIVOT the SQL query and then just create a simple SSRS report, or if you want to keep the pivoting/formatting in SSRS you should use a Matrix.
For the Matrix use the Department as your "Rows" input. Use FORMAT(created_date, "ddd") as your "Columns" input. And use sales_spti as your "Data" input.
You can sort the columns using DAYOFWEEK(created_date), which would order them Monday(1) through Sunday(7). See SSRS Date functions for further info.
Upvotes: 1