Building SSRS time series report from SQL datetime column - sql

I need to create a SSRS report where the user specifies the start and end date (e.g. March 2012 to July 2012) and the result is a report with the following headings:
User Department Product Mar-12 Apr-12 May-12 Jun-12 Jul-12
The dates are stored in a datetime column (e.g.2012-06-11 14:48:04.787) in my SQL table which I'm using to build the time-series report.
Do I need to convert/transpose my SQL table first? Or should I be processing this in SSRS?
Your advice is much appreciated!

Based on your question it appears all your dates are in a single datetime column and your trying to display them, formatted as a month, in a single report with the report columns grouped and renamed based on the month. This is a pivot and I don't think you can do that within SSRS. The dataset will already need to be pivoted by the time SSRS gets it.
So, to me this sounds like something you'll have to do both pre and post SSRS. I did a similar report using days of the month. You can see the winning answer here. as opposed to months of the year.
Thinking through your logice, I think you'll probably have to build the query with the pivot and then send to SSRS. On the SSRS side you need 12 columns for all 12 months and then put some logic to hide the ones that don't get data. Your original pivot will need to be smart enough to pass the empty months so SSRS doesn't error out. The end result will appear the same but needs a lot of pre-thought and design effort up front.

You do the processing using SSRS - you would design it in the GUI editor(BIDS ) , and you can customize things using the VBasic code also(i.e, dates and logic)
Looks like you need an intro, I really recommend this video

Related

SSRS data driven query?

I've got a question and it may sound dumb but am figuring it out as I go...
In SSRS there is an option to have a data driven query and in that you can edit the dataset to read parameters of the report who to send to ect., ect.,
Is there a way to have the query read an output of a subquery and if it doesn't equal the output it doesn't send but if it does, it does trigger the report sending?
In this particular example, the report needs to be triggered to send on the 3rd business day of the month. I have a query that reads the third business day written up but I am not sure how to get it into the query and read as if the date = 2023/01/04 then trigger report and send it off, otherwise do nothing, checking daily if it is that date.
In my business day query it has the columns, Date - which is the date, DayOfWeek - which is the numeral day of the week 2-6(for weekdays), Year, Month, Day, and Working day of the month(which is all 3s being the third business day.)
Should I have the query set to reading if workingdayofmonth = 3 then trigger the report? Would that be the easiest? I am not entirely sure how to code it as such into the SSRS data driven query.
Thank you for your time and help!
If you are using Enterprise edition, you can setup a data driven subscription.
I don't use Enterprise so I can't give a working exmaple but essentially, you create a dataset for the subscription that will only return data if your conditions are met.
As you previous question (linked here for other users reference) got you a calendar view that gives you the days the report needs to run, you can use that view, something like
SELECT * FROM myCalendarView WHERE TheDate = CAST(GetDate() AS Date)
The subscription will attempt to run everyday (or whatever the schedule is) but it will not produce anything unless the query above returns a resultset.
Take a look at this post which is similar to what you are attempting.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/88b6c7ec-3cba-4b5f-b09d-c098dc933063/how-to-modify-an-ssrs-subscription-to-only-run-first-monday-of-every-fiscal-month?forum=sqlreportingservices

Business Objects (webi) stuck forever on retrieving data for specific dates

I am very new to BO webintelligence.
I am doing a very simple query, retrieve Sales Amount for dates between 2012 and 2013. Just for this simple query when I run it, my BO crashes or gets stuck on "please wait" window. Why is this happening? If I select like 3 or 4 days like between Jan 1st 2012 and Jan 4th 2012, it runs fine. Is there anything from my end that I am doing wrong? This is in production mode.
I also wanted to point out that I have tried limiting my data set for specific region etc.
Too many unknowns to successfully assist. I presume this is webi 3.1.x or 4.1.x and I presume that the Sales Amount is a measure and that your query includes a date which does not include a time component. If you only have these two objects in your results pane and have the region in your conditions then pulling something like [Date] and sum([Sales Amt]) should not take long to execute. As previous poster suggests, try to execute the sql in a tool like SQL*Developer or Management Studio or however the source database / OLAP is stored.
Even though you've limited the data to a "region" this may be too much data. Try selecting a smaller result set of 100 rows or changing the option for "retrieve duplicate rows" on the query panel.
If possible, post the query from your report using generic object names?

TSQL Paramterised Pivot Query SP SSRS

Wonder if anyone has done this before and what solution you came up with?
I have a Stored Proc that basically is a financial aged debtors query. I have added params to it so that you can select the Start Date, Frequency and Period length of the query. e.g. I could pick 12 months back from TODAY or 01/01/2012 or 4 Quarters back or 1 year back depending on the detail of the output I wish to see.
All well and good and when I run it in SQL it is lovely and works beautifully. I have pivoted the data within the SP in different ways depending on the Period param so that the columns show correctly (i.e. Shows the month name column for months, Quarter name for quarters etc etc.) so the pivot is conditional on the input parameter.
As I say in SQL it is a beautiful thing... now how the hell do I display it in SSRS!? :o)
As the PIVOT is conditional I can't see the available fields and I've got to a point where I can't think anymore of a way around it.
Any help appreciated!
Assuming I got you right, there is an option to place the entire SP in the Dataset.
In the dataset properties , change the query type to Store Procedure.
Hope it helps for you...

PPS / Performance Point Date Range for Scorecards

How do I go about adding a From and To date range to a scorecard and analytic report?
It doesn't seem to be well documented anywhere (including PPS books!) but surely a basic requirement for any report.
Is it possible? Or is it necessary to add 2 filters: a DateTime picker and a 'Lag' filter (which contains the number of days / weeks / months in a dropdown):
The requirement is to create a scorecard, with KPIs based on previous years performance, so there are 2 date parameters both of which need to be passed into the KPI to filter down the results (ParallelPeriod).
Thanks in advance
You can do this with analytical reports, but not with the scorecard. For the report I wouldn't necessarily recommend it because you will need to modify the MDX to setup parameters and that means you will lose the interactivity features with the report. Here is an example of setting up parameters in the MDX - http://dailyitsolutions.blogspot.com/2011/01/from-date-to-date-in-performancepoint.html.
Dashboarding is typically looking at and anlyzing periods of times which you can easily do versus the date ranges that you would typically find in operational reporting. You might want to take a look at possibly using some time intelligence features that are available in PerformancePoint if you do not have this available in your SSAS database.
Here is an overview on the TI formulas - http://blogs.msdn.com/b/performancepoint/archive/2010/01/21/time-intelligence-formula-quick-reference.aspx

How do I automate a report on variance in the same SQL table fields on monthly basis?

I have a T-SQL view with integer fields. I need a report on a monthly basis regarding the difference from one month to the next, i.e. so many people were engaged in a particular activity on 8am of the 1st of this month, so many the previous month, here is the difference. The numbers fluctuate all the time. I need a variance between 2 snapshots in time.
I am using the SSRS, however in reporting services I can only display the "current" situation. I could run a report at 8am of the 1st of each month and then calculate the differences manually. But how could I automate this calculation and then report on the difference?
I have tried to import data from SQL to 1 Excel spreadsheet from 1 month, then to the 2nd spreadsheet from the 2nd month. The 3rd spreadsheet calculates the difference. But how do I create a nice looking report from Excel?
Additionally I cannot send the report by email. It has to be available online.
Furthermore, each office wants their figures to be confidential and not visible to another office.
Thanx in advance.
Can you add a UserCount table that stores each office's user count for each month? It could have columns like:
id
date
user_count
office_id
You would insert a new row each month based on what the view tells you that month for each office. Then it's as simple as exporting that table to Excel and graphing it using Excel's built-in graphing tools.