I have two different data sets using two different SQL queries. Essentially one data set is day/caller stats rolled up the other set is call data. So each call data set rolls up to get their day/caller data.
I needed to separate these two queries for performance because I needed one extract and one parameterized custom query for the call data. So essentially I will always bring in this month of data and last month for the day/caller data.
What I need to do is create one dashboard, that has the caller and all of their stats aggregated for the time period. Then I need to be able to click a row to prompt all the call data in a different sheet on the same dashboard
I am at the home stretch and need a way to connect these two sheets and update the call data. Right now I only have a parameter for the Unique ID of the callers not time, I bring in all the same days of calls even though it is really not needed. In a perfect world I will click the report caller and my second query will update to the appropriate day range and Unique ID and produce only that callers calls. My problem right now is no matter what I do I cannot create the one sheet to update the second call sheet. I have successfully created a manually functioning report but I need the action to filter to a timer period and the specific caller.
Let me know if you have any feedback. My two issues are creating two separate queries caller data (225k rows help in export) call data (7 million rows if unfiltered) which needs to be a live connection so when sheet is clicked the parameters will update and those calls will populate. Anything would help!
The solution i can think of is to use an action filter and there is an option below to select the fields to map between the sheets.Choose selected fields instead of all fields and map the id and time between the two data sources.
Apart from this i dont really get what the issue is.If you need further clarifications please rephrase your questions and provide examples and your data structure.
Related
I have a SSRS report with 20 different datasets with some calculated columns in each.
I want to take few fields from all data sets including some calculated columns and insert them into a SQL table.
I want to do this for each month so that I can see the trends during a period. Is there any way to do that with out editing the data sets?
Can I refer the fields that I need by referring to Textbox4 and insert them into a SQL table? What is the easy way to do without touching data sets?
There is most likely alot better solution than using SSRS to update a SQL database. I am not proposing this as the best solution but rather a way to achieve what was asked.
You could create a dataset that runs a stored procedure you can pass the data as parameters to. The Sproc would do the insert into your chosen table and you can pass in the parameters from your original dataset however you see fit. You could even setup a second report with the Stored procedure Dataset that you can call on command by having an action event on an item to call the report. (I had a subreport embedded in a column of a tablix configured so it would only update with values from that row for instance).
To clarify:
Create a subreport that accepts the data you want to insert as a parameter for each column
Instead of adding a normal Dataset, have it call a stored procedure that inserts as you require
Add the subreport to your main report to be called once its run and configure the required parameters to be passed through.
There will be better, more efficient, cleaner ways to do this, but I found the above to work for my purposes since I was limited by time and resources. But I would still recommend you seek other solutions if possible.
I've been banging my head against this for about a year on and off and I just hit a crunch time.
Business Issue: We use a software called Compeat Advantage (General Ledger system) and they provide a Excel add-in that allows you to use a function to retrieve data from the Microsoft SQL database. The problem is that it must make a call to the database for each cell with that function. On average it takes about .2 seconds to make the call and retrieve the data. Not bad except when a report has these in volume. Our standard report built with it has ~1,000 calls. So by math it takes just over 3 minutes to produce the report.
Again, in and of itself not a bad amount of time for a fully custom report. The issue I am trying to address that is one of the smaller reports ran, AND in some cases we have to produce 30 variants of the same report unique per location.
Arguments in function are; Unit(s) [String], Account(s) [String], Start Date, End Date. All of this is retrieved in a SUM() for all info to result in a single [Double] being returned.
SELECT SUM(acctvalue)
FROM acctingtbl
WHERE DATE BETWEEN startDate AND endDate AND storeCode = Unit(s) AND Acct = Account(s)
Solution Sought: For the standard report there is only three variation of the data retrieved (Current Year, Prior Year, and Budget) and if they are all retrieved in bulk but in detailed tables/arrays the 3 minute report would drop to less than a second to produce.
I want to find a way to retrieve in line item detail and store locally to access without the need to create a ODBC for every single function call on the sheet.
SELECT Unit, Account, SUM(acctvalue)
FROM acctingtbl
WHERE date BETWEEN startDate AND endDate
GROUP BY Unit, Account
Help: I am failing to find a functional way to do this. The largest problem I have is the scope/persistence of data. It is easy to call for all the data I need from the database, but keeping it around for use is killing me. Since these are spreadsheet functions after the call the data in the variables is released so I end up in the same spot. Each function call on the sheet takes .2 seconds.
I have tried storing the data in a CSV file but continue to have data handling issues is so far as moving it from the CSV to an array to search and sum data. I don't want to manipulate registry to store the info.
I am coming to the conclusion if I want this to work I will need to call the database, store the data in a .veryhidden tab, and then pull it forward from there.
Any thoughts would be much appreciated on what process I should use.
Okay!
After some lucking Google-fu I found a passable work around.
VBA - Update Other Cells via User-Defined Function This provided many of the answers.
Beyond his code I had to add code to make that sheet calculate ever time the UDF was called to check the trigger. I did that by doing a simple cell + cell formula and having a random number placed in it every time the workbook calculates.
I am expanding the code in the Workbook section now to fill in the holes.
Should solve the issue!
I'm attempting to create a MS Query to return data from a SQL database based on a value from a cell in Excel. I have actually successful accomplished this, but only for 1 row. I cant figure out how to get it to copy-down to other rows.
I've created a connection as follows:
Notice that the SQL statement includes a parameter. The parameter is set to point to a specific cell:
I guess this makes sense as I'm only looking to return 1 value per row:The problem is that I have multiple lines to return values for. How do I return a value per row for multiple rows?
I've tried changing the cell reference in the Parameters dialog box, but this does not work as the Excel Table is designed to grow dynamically.
Excel data connections works in a way that every connection has only one SQL Query. So in order to do what you'r looking for, you will need to have many connections, and that's not the "best practice".
However, there are two ways you can solve this situation:
1. Make a single connection with all of the data and create a pivot table based on it. Then use VLOOKUP/INDEX to gather the data to your requested cells.
2. If the data is too big, you can use VBA code to create a smaller Query based on the cells you mentioned and then continue as described on the first option.
Good luck.
I just started working with SSRS, and figured out how to connect my MDX Query to a Cube and plug that into a Matrix
However, i need to have a matrix, and in each section, i need to call a different DataSet.
For example:
Matrix1 would have a repeating section based off DataSetA (let's say its customer centers).
in each section (customer center) of Matrix1 i would have a Expression, which calls DatasetB, using a value from DataSetA as parameter (let's say it would be a separate MDX query getting some other information based on customer center ID).
so my expression from within a tablix cell is something like this:
=First(Fields!MTD_Trades.Value, "DatasetB")
is it possible to pass a MDX query filter (or where clause) using a parameter from this point?
ideally it would be something like this (pseudo code):
=First(Fields!MTD_Trades.Value, "DatasetB") WHERE Fields!Where_Filter.Value
something along these lines.. where the MDX WHERE section is dynamic based off another query
UPDATE - solution explanation
here is an example of what i am doing: Let's say the application is based on air traffic and the business user here is some aviation authority person. I will give that person a UI that will let them define the slices they want to see. For example they can come in, and create n slices (i.e. International Flights, Flights leaving US, Flights Arriving After Midnight, Flights with 50+ passengers... n). As you can see, they will have the freedom of adding any filters they wish to each slice.
Then based on their actions (using GUI), i will generate the necessary MDX queries (one for each slice).
My challenge here is to create a SSRS report that will show a separate line for each one of those slices (1-n). Hope that helps in understanding my conundrum. The first part of the query will be the same for each slice (# of flights), but the WHERE section will be different and dynamic for the report.
You can use the lookup() function to access data in another dataset from within a reportitem but you cannot run multiple sub-queries within the report. You can only do this within the parameters where one parameter can be an input for another query driven parameter.
The best course of action is to modify your original query to contain all the data you need for the Matrix.
EDIT: It sounds like you need to use a multivalue parameter.
In the "Slices" parameter set it to allow multiple values
In the dataset which accept this parameter, goto the parameters form and set the value to an expression which is =Join(Parameters!Slices.Value,",").
Pull apart the string in you query and run each subquery then return as a set.
I am going to design a report using SSRS 2005. Is it possible to have the selection of dataset done dynamically?
Let's say I am going to have two tables, where the first one is the summary and the second is the detail data. One of my parameters (with values Summary and Detail) will determine which version of the report is to be displayed. Can I have two different datasets, and while clicking the view report button in parameter view dialog (or before) set which dataset which will be used?
You can use the single data set by using switch statement some thing like this:
You can type this in data tab but the results can be seen only in preview tab, but not the data tab like regular queries.
=Switch(Parameters!ToDecide.Value = "Summary",
"Your query for Summary",
Parameters!ToDecide.Value = "Detail",
"Your query for Detail")
Make sure you don't have any excess spaces with in the query(not more than one space where needed)
Both the queries should return the values required by the Table in Layout.
You'll probably have to have 2 pairs of table contained in, say, a rectangle, and hide the unused one (at the container level). Or use subreports.
If you find a way to switch datasets, then you'll have to make sure that all columns are the same as well as making sure that any functions using the DataSet as a scope parameter are changed too... which makes me think it just isn't supported.
You might want to try using a single dataset and having a summary and detail data region (table, list, etc.) in the report, one of which is visible and one of which is not. In this scenario, the dataset is only evaluated once and you are still meet your requirement.
Hope this helps,
Bill
It would be easier to create and maintain if you have two separate tables and hide one or the other depending on the choice made.
I haven't tried this, but I think another possibility would be to use three reports: a container, a summary subreport, and a detail subreport. Switch between the subreports according to the choice.
There is a performance gotcha to the first implementation though. SSRS will try to fill every DataSet in the report when it loads, even ones that are not used in the report's output or by other DataSets or expressions. In other words, just because you're displaying the summary report, doesn't mean that you're not asking the database to fill out your detail data as well.
There is a workaround that can improve the performance a bit, but will still end up with a trip to the server. The hack is to set a flag parameter to determine whether or not the query should actually return any real results or if it should just return the columns you want.
You may try adding condition that depends on a cetain parameter to execute. Then from there, You may use different data set. Assuming that you'll use it on separate hidden tablix.