Excel Query Versioning - sql

Scenario - I have embedded a query into an excel workbook and distributed it to say 10 people in my company. This workbook can also be found on a shared drive and is considered the master workbook. Each of the 10 people make a, save as, copy with their own filters etc etc. They can refresh the query as needed and everyone is happy. 2 months later, something changes in our tables and I need to update the query with additional code. I can do so in the saved workbook on the shared drive but now all the 10 users copied versions of excel are still utilizing the old code.
How can I make their versions dependent on any changes to the embedded query in the "master" copy of the workbook? Is this even possible? If not and considering that embedded queries in excel are a company requirement, what is the best way to solve the problem I have described above? We have SSRS but management wants to move away from that and prefers excel reporting.

Related

Running SQL on Excel like Query on Google Sheets

I have a large database on Microsoft Excel 2010 on which I want to run SQL queries like the =QUERY formula in Google Sheets.
Basically on Google Sheets, the =QUERY can reference cells which take user input. This allows me to dynamically update the table based on the user input fed into the =QUERY. I've created a Google Sheet exemplifying what I mean here (please change cell G3 only) - the only difference between this and the final product would be that the complete table is in a sheet and the dynamically updated one is in another.
I've created a connection in Data Wizard in Excel but it doesn't seem like I'd be able to take user input running queries from there. Also, I've found similar questions here but neither provided an answer to this question specifically.
I want to do the exact same thing on Excel - being I do not want to use VBA, Filters, etc. I want precisely this. Is there a way to do this?
EDIT: I've tried Advanced Filters but they don't respond dynamically to different user input: you input once, it gives you the result, you go back and change parameters and it doesn't change it again.
You can use POWER QUERY for Excel, Info, Download.

Link Data Models to multiple files

I created a file that imports multiple tables, and then I do several modifications and calculations with Power Pivot. The problem is that I want to use the final results, not only in that current workbook, but also in other workbooks.
So my question is, is there a way to link other excel files to that data model that I created and worked on?
Please note the data changes every day, so I am looking for a permanent connection.
Appreciate any help here.
if I understand you correctly you would like to access the PowerPivot model/measures that you have created in one xls file from within other xls files.
If so, the "core" vs. "thin" workbook approach might be what you are looking for. This approach works with Excel 2010 but not with Excel 2013 however and you will need a Sharepoint Server with PowerPivot for this to work.
The approach is described in Rob Collie's awesome PowerPivot blog:
http://www.powerpivotpro.com/2011/02/powerpivot-scheduled-refresh-pt-3-thin-workbooks/
and here:
https://pivotstreamllc.zendesk.com/hc/en-us/articles/201148566-Splitting-Workbooks-into-Core-Thin-Pairs
another option is to load all your data source in one Master workbook, then write back the result in the same workbook using Reverse Linked Tables.
Now you can use that Master workbook as your backend for all your reports.
or use PowerBI Desktop as your backend, officially it is not support but Excel can have a local connection to PowerBI desktop.
I put more details here
https://datamonkeysite.com/2016/11/13/thin-and-core-workbook-without-sharepoint-or-ssas/

Create SQL Table that will import automatic from Excel whenever that Excel is updated

So I have an excel spreadsheet with Product and Notes. I'd like to import this information into SQL and everytime people enter more products and notes into this excel sheet, it will automatically updated to the new one whenever I run the syntax?
I finished creating Product - Notes, which I imported current data into that table.I was planning to use insert into function, and every day insert the new values in the table. But this seems too manual.
Is there a way i can do this? The excel spreadsheet is updated daily.
I'm using SQL Server 2008
I'm sure this is possible. You could have the excel connect to your database and then write some macros to save the data to the table when there are changes or new rows are written.
It would not be easy. There is a lot of complicated logic here and excel was not written to be a front end for a database.
I believe the time spent changing your spreadsheet to work this way would be better spent actually writing a client server application to modify the database using a web application or a local application. Client server front end applications are easy to write these days with lots of examples, tools and templates. For someone with experience a simple data entry / modification form is just a couple of days work for a robust application.
Changing the excel file would be much harder.
You could use SSIS to import the excel data into your database on a scheduled basis.

Excel 2010 Data -> "Refresh All" slow

Presently am working with an Excel spreadsheet that makes at least 10 database queries to external Microsoft Access *.mdb files. For each project my company works on, we have a specific excel file related to that project, so we have hundreds of these files. Usually when an analyst opens the Data tab and click on "Refresh All" the refresh completes in a minute or two; however, on a new project for a given excel file it is taking at least an hour to complete the refresh. Here is an example of one of the connection strings:
DSN=MS Access Database;DBQ=W:\Projects\Analysis\project.mdb;DefaultDir=W:\Projects\Analysis\Analysis;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;
And here is the associated query:
SELECT Field.FieldNumber, Field.FieldName, Field.GroupMnemonic, Field.ClientFieldID
FROM Field Field
ORDER BY Field.FieldName
I have spent time studying various websites discussing slow excel issues like http://msdn.microsoft.com/en-us/library/ff700515.aspx; however, these websites deal more with calculations and VBA whereas I suspect the performance problem is somewhere in an access file. Does anyone have any suggestions on how to troubleshoot and resolve this issue? TIA.
UPDATE: As suggested in the answer below by JohnFx, I checked the queries and found that they had no definite keys, so and so added keys in the Microsoft Access database generation like this:
CREATE UNIQUE INDEX PIndex ON [myTable] ([KEY])
Run the queries individually directly in Access to rule Excel in or out as part of the problem. If the queries are still slow in Access consider adding indexes on any columns that are in being sorted or filtered on.

Exporting Excel files from SAP with pivot tables

I currently have a report which will be emailed to business users weekly. The data output can only be csv/xml and I do not have the ability to automatically add the requested pivot tables; therefore, I am attempting to pull the data with a Workbook_Open sub routine in an Excel file I will have premade. My issue here is I cannot use Macros on SharePoint nor can the Data be publicly accessed in a Macro...so I feel like I am up a creek.
Any suggestions from a VBA, Excel, or BEX/BOBJ standpoint?
Well if your report is forced to be csv/xml.... and you can't access the data directly through a macro... the solution is not terribly straight forward.
Here is how I would solve
1) SAP Job drops off file
2) Some type of automation kicks off a macro
3) Macro formats and emails report
probably possible to have sap email a spreadsheet formatted to taste directly via abap code.... that is not something i have much experience with.