ssrs/ssrb end user picks a date to filter by - sql-server-2008-r2

I'm using sql server 2008 r2 and i'm new to building reports with ssrs. I have the reports built, but i'm trying to make it so when the end user, goes to the report on the site, they are able to pick a start and end date. So the data gets filtered by those, to look at it each quarter.
I've been looking through the interwebs for a few hours and it looks like people are able to do this, but i haven't seen anything on how yet.
Also i see there is a date picker thats greyed out, but I've read that it can only be used in web projects, is that what I'm looking for?

I don't have 2008 but in 2012 you would simply define 2 parameters as date/time and amend your dataset to include them. For example
SELECT SalesOrderID, OrderDate, Status, TotalDue
FROM Sales.SalesOrderHeader
where orderdate between #lodate and #hidate
The datasource in this case is advicentureworks2012.
SSRS automatically adds the parameters to the report and includes a date picker.

Related

Financial formulation in Crystal Reports

I need help with creating a trial balance report for a specific tenure, from beginning of fiscal year to a selected period. I need this in Crystal Reports.
I am unable to formulate how can I get debit and credit amounts totalling from beginning of the fiscal year till the end of selected period (not YTD).
For example, I want to get a trial balance report till period 6 (June), I am able to get the balance at the end of period 6, but unable to formulate total credits and total debits for selected number of periods/months. Instead, it is either debit/credit amounts for June or it's for total debit/credits till date.
Can anyone help me please?
Create a formula that returns, for each record, it's dollar amount if it's within the target date range, otherwise, zero.
Sum that formula to get the total for that time period.
I'm a user of the DelmiaWorks/IQMS ERP solution as well. IQMS uses a stored procedure to populate a database table named "C_TRIAL_BALANCE_AS_OF". When you publish a report into IQMS, there is a field named "Execute Before Print" on the Edit Report Definition window that opens when edit a report. To run this stored procedure in conjunction with another report, you will want to choose "POP_C_TRIAL_BALANCE_AS_OF" in the drop-down box control for this field. This will ensure the procedure is run prior to the report so you have the account balances you need as of a specified date. When the report is executed, IQMS will present the user with a Date Picker for the As Of Date. Almost all of the data you need to do a Trial Balance report can be found on this calculated table. The only joins needed should be "V_GLYEAR_PERIODS", "V_GLACCT", and "EPLANT".
There is a built-in report that may do what you want already though. If you begin the Trial Balance module and then click "Reports" > "Print" to bring up the list of all reports, then look for one named "Trial Balance As Of". Even if this report is lacking some information you need, it will likely be much easier to edit this existing report than it would be to create one from scratch.
If you don't have this built-in report, you may be able to get a copy of the RPT file from their support department. As long as you have the Trial Balance module, you should have this report. Its a standard report that is included in every version of IQMS I've worked with. However, my experience is limited to the 15.3 and 2020 versions.

Get value from Measure in OLAP Cube and Insert it in a SQL table

I need help with the the following:
I got an OLAP Cube, let's call it "company_prod" on "server\instance"
That Cube has (among many) a calculated member called "[Measures].[Value]"
One of the Dimensions in the Cube is for time (Year, Month, Date and so on). e.g. [TIME].[Y_M_D].[YEAR].&[2020]
Our main frontend is Excel, where we retrieve Data from the Cube with CUBEELEMENT, CUBEVALUE etc.
We got some measures which unfortunately, when I update the Excel report now and show numbers for last year, the result is different when I update that same report in a few weeks or months. This is something I won't be able to change and in some reports it's the desired behaviour because underlying data from SAP is changed and sometimes valid_from and valid_to dates are changed retroactively.
Now I want to get the value from my "[Measures].[Value]" on a certain date, let's say April 1st. I then want to insert the value I get on April 1st for 2020 in a SQL table. This should be done by an agent job that executes a stored procedure or runs a dtsx package or anything else, whichever works.
I hope it's clear what I am trying to accomplish...
If you can create linked servers from your SQL Server to SSAS Server, then you can run your MDX query against the linked SSAS Server using OPENQUERY and save the result directly to the SQL Server table.
i.e.,
INSERT INTO <your table>
EXECUTE <your mdx statement> AT <linked server>
You can add the run the above via your SQL Agent job on schedule.

Tableau Include Latest Revision (Publish) Date in Dashboard

I have a dashboard I am developing in 2018.2.3 Desktop that will eventually get published to our internal Tableau Web Portal. I am writing a "Help" tab that has some documentation, directions, etc. for users to view in case they are curious what report is for, how to use it, definitions, etc..
One piece that I want to include at the header of this are three dates:
Report Created
Report Data Refresh
Report Publish Date
The first two are simple, the "Report Created" is just text, since I have no idea how to get the date the report was actually started. Text is fine for this. The Data Refresh is simple as using the, "". That works perfectly.
My only issue is I'd like to include the most recent publish date / revision. Now, I see this in the Tableau Web as meta data on the dashboard, but I'd like it to be part of this "Help" page. Is there a way to do this with some sort of dimension or variable? Thanks in advance.
If you are on Server and not Online, you can take a look at getting this data from the WORKGROUP database that Tableau Server runs from. Use this guide from Tableau to get that setup.
Then you will want to look at the workbook, sites and workbook_versions tables. Here is a sample query that could help.
select s.name site, w.name workbook, wv.version_number, wv.published_at, w.updated_at
from workbooks w
left join sites s on w.site_id = s.id
left join workbook_versions wv on w.id = wv.workbook_id
where upper(w.name) like '%<WORKBOOK>%'
group by 1,2,3,4,5
having w.updated_at = max(w.updated_at)
published_at is a timestamp of the initial publish.
updated_at is the last date it was updated.
version_number is a count of how many times the workbook has been published to on that site.
Here is a data dictionary for all the other available tables.
You can pull this query as a new data source and build the text that you want to display.

Dynamic Reporting Day in Tableau Dashboard

I have been trying my hands on something in Tableau and finding it hard to implement. I have attached my sample workbook and the data source I am using from excel. The second tab in Excel shows the final dashboards I want to see as the end result; the first of which I have accomplished in Tableau using the desktop version.
There are 5 kinds of products for which the quality runs happen at different times. My goal is to return the 'Result' of the product based on the latest available 'Quality Run Time' which is 29th March 2018. I got to this part using two calculated fields below:
{FIXED [Product] : MAX([Quality Run Time])} as 'Max_Date'
IF [Quality Run Time] = [Max_Date] THEN [Result] END as 'Max_Result'
The result of this is in the workbook. The problem is I want a dynamic 'Reporting Period' filter for the user to be able to choose from available dates in the 'Quality Run Time.' For example if I wanted to run a report for 27th March 2018, based on the logic I should see the dashboard below (ex from Tab 2 in Excel). I am guessing my calculated fields need to be dynamic somehow and I have tried many different options but it hasn't worked yet.
Please pickup data source and workbook from here
Your logic doesn't work as expected.
You need to create a parameter with datatype DATE and then use that in filter.
I have changed the report and attached in the same link.
I have changed in Tableau version 10.5
Edit---------------------------------------------------
Updated with v10.4 in same link

Create a warning prompt box that appears before parameters are set in Crystal Reports

I have created a Crystal Report for some of my users with a date range parameter set. The volume of information that the SQL command returns means that anything over a 7 day period in the date parameter slows the report to unusable speeds and subsequently locks the DB for all other users.
Does anyone know of a way to create a prompt in Crystal Reports that will appear before the parameter set? I.e. As soon as they select the report and click "Open", the first thing they see is a box saying "Please ensure a maximum 7 day date period". Then upon clicking "OK" or something of my choosing, they are presented with the parameter fields and can continue with the report.
If this cannot be done, is there a way to restrict the parameters so that when the users select the start date, they can only select a maximum of 7 days after.
The other option, if it is doable, is to have them select the start date and then it auto complete the end date with a date 7 days after the start date.
At the moment i have just added (Must be a 7 day period) to the parameter title but i dont feel this does a good enough job at advertising it and as soon as i publish it i know someone will want to get 4/5 years worth of data...our clinicians will be most unimpressed if they PAS system locks up during a busy clinic.
I have attached a screenshot of the kind of thing i am after. It is a little crude as it was done in paint but it gets the point across.
I have searched high and low for this solution so i am not sure it even exists, but am asking out of sheer desperation.
Thanks in advance,
Mike
If you use Crystal Report solely (not within a program like .Net app) you can select your latest proposition. Get start date and in your SQL command (View, Stored Procedure, ...) select items from startDate to startDate + 7 days.
Depending on your DBMS there are ways to add some value to date (like dateadd function in MSSQL).
So its done.