Has anyone created a report that could use an Excel spreadsheet attached by the user as a parameter for the report? An example would be a list of potential customers in Excel, and whether they exist or don't exist in the database.
I know something like this is easier to accomplish with a manual SSMS query. However, we have several query requests similar to this which are common requests.
Basically want the user to attach their spreadsheet and compare it with data in the database and then spit out a comparison report.
Use SSIS job to load data from spreadsheet to database and then compare data in usual way with queries.
Related
I have a report that I generate on a weekly basis. I have the code written in SQL and I then pull all the data into excel's data model.
I then create pivot tables and dashboards in excel from that particular data.
The SQL code creates new table of the same name everytime and deletes the older version of the table. There isn't any way for me to just append the new data as the report is run from the very start and not just on the new data.
I wish to automate this process of refreshing my dashboard from the data I produce in SQL. Is there a way to do so?
Currently I create a new table in SQL, import data into the excel's data model and then recreate the dashboard.
I am not even sure if this is possible. Any help would be greatly appreciated!
Solved!
After some digging, I was able to find a feature that Excel's data model supports.
Instead of making a connection directly to a SQL Server Table, you can create a connection by writing a SQL Query.
This way, even if you delete the table for updating it, as far as the name remains the same, Excel's data model would be able to pull data from the table just by you hitting refresh!
We have one stored procedure which has different input parameters and it is fetching data from multiple tables.
Also we have on excel template with multiple sheet. we want to insert data into excel sheet by creating different queries.
Does anybody tried that before?
There are different ways to achieve this. When you want to write a program using .Net (what I expect from your tags), I can recommend EPPlus.
I have an excel work book that allows users to update multiple SQL statements at once based on data entered into cells.
Then the users copy the updated SQL and go into Tableau and paste it into the corresponding custom SQL data source in tableau and refresh it.
Is there a way to send the updated SQL code directly to the corresponding connection in Tableau?
If the table name is changing, that presents a challenge.
I have two suggestions.
Modify the twb xml.
A Tableau workbook file is simply an XML file. One part of the xml contains the connection information, including your custom SQL. VBA has some libraries for manipulating XML. You can write some custom VBA code to modify the XML that contains the custom SQL.
Use VBA to create/alter a view in teradata
Teradata allows database views. With VBA, you can connect to teradata and create/alter a view that changes based on your parameters from Excel. The key is to keep the view name constant, then Tableau will not need to be changed each time the underlying view definition is changed.
Of the two, my first choice would be the second option. It's cleaner and doesn't require distributing a new workbook file each time.
I have got the following Problem.
I have several Excel files containing each the data of a country in one folder.
However I want to pull that all into one Excel report.
As the content of the source files change dayly, I guess the best way to do that is to do a import via an SQL Statement using Union All.
However the problem is that MSQuery only allows me to Access one file at a time. Is there a Workaround for that problem?
Maybe create a data model and use DAX?
This sounds like a job for Power Query, a free add-in from Microsoft for Excel 2010 and Excel 2013, and built into Excel 2016 as "Get and Transform" in the Data ribbon.
You can create individual queries to the different Excel files in the different folder, then create a query that appends all previous queries into one table, which can be loaded to the Excel data model or a worksheet table for further processing.
The queries can be refreshed with a click when the data has changed.
I need to save the results of a SQL Server stored procedure into an Excel file.
How can I do this programatically, as part of the same stored procedure - preferably as the last step of the stored procedure?
Please note that I do not have a separate web application. I want to perform this save functionality to Excel, as part of the stored procedure itself.
This is a bit long for a comment.
My first suggestion is to save the data as a delimited file, which can easily be imported into Excel. This should be fine for archival purposes, for instance, or for sending the results around by email.
The next suggestion is to save the results in a table, and to have a data connection to that table. You can then have a query in the Excel file that automatically refreshes the data. This is handy for having special formatting and charts in the Excel file.
Another option is to use openrowset() to directly write to an Excel file. The process would often be something like copying a template file to a new location and then writing the data to it.
The best method really depends on what you want to do with the results.