Possibility of inserting manual columns between a Google Connected Sheet columns Powered by Big Query - sql

I'm trying to insert a manual column in between a Big Query generated extract columns via Connected Sheet. Basically, I already have a Google Connected Sheet which is pulling from Big Query via SQL. Whenever I try to insert a manual column in between columns generated by the query though, it automatically moves the manual column to the very end on the right or to the very end on the left. I don't want this. I want to be able to insert a manual column in between a Big Query generated column in a Google Sheet.
Is it not possible to do this? Or is there another way to be able to pull something like this off? I can't find any videos or specific documentation on if it's possible.

See below answer to questions:
Is it not possible to do this?
As per this documentation:
Direct access to BigQuery datasets and tables is still controlled within BigQuery. A user with Sheets-only access can perform analysis in the sheet and use other Sheets features, but the user will not be able to perform the following actions:
Manually refresh the BigQuery data in the sheet.
Schedule a refresh of the data in the sheet.
Hence, you cannot manually create a column when you use Connected Sheets when accessing Bigquery Data. The main function of Connected sheets in this use case is to analyze and visualize data from Bigquery, and not to manipulate data.
Is there another way to be able to pull something like this off?
Option 1: extract from Sheets the data from Bigquery
Then you can see that the Insert function is enabled. You may insert another column in this extracted sheet:
Option 2: Download the sheet as an excel file and insert column in between once downloaded:

Related

Create table schema and load data in bigquery table using source google drive

I am creating table using google drive as a source and google sheet as a format.
I have selected "Drive" as a value for create table from. For file Format, I selected Google Sheet.
Also I selected the Auto Detect Schema and input parameters.
Its creating the table but the first row of the sheet is also loaded as a data instead of table fields.
Kindly tell me what I need to do to get the first row of the sheet as a table column name not as a data.
It would have been helpful if you could include a screenshot of the top few rows of the file you're trying to upload at least to see the data types you have in there. BigQuery, at least as of when this response was composed, cannot differentiate between column names and data rows if both have similar datatypes while schema auto detection is used. For instance, if your data looks like this:
headerA, headerB
row1a, row1b
row2a, row2b
row3a, row3b
BigQuery would not be able to detect the column names (at least automatically using the UI options alone) since all the headers and row data are Strings. The "Header rows to skip" option would not help with this.
Schema auto detection should be able to detect and differentiate column names from data rows when you have different data types for different columns though.
You have an option to skip header row in Advanced options. Simply put 1 as the number of rows to skip (your first row is where your header is). It will skip the first row and use it as the values for your header.

Is there any way use the values in a cell to query a SQL table and see if the value exists in the table?

I have an Excel spreadsheet containing all of my company's Vendor Codes. When a new code is added to this spreadsheet, we then add it to a configuration table within our database which allows us to accept that vendor. Right now I'm going through my Excel Spreadsheet and reviewing each section of code to find out if it exists in the SQL Table.
Is there any way use the values in a cell to query my VendorConfig table and see if it exists?
Spreadsheet Columns: VendorID, VendorCode, Config
You could use the "get external data" command to bring a value into a cell to check against. Alternatively, here is a link to a web post that has a cool answer to this problem (NOTE: I haven't actually tried this code but, from a quick glance, it looks right): Add formula to excel to validate data

In SQL how do I update a table with a similar table?

In my current Database I have a table whose data is manually entered or comes in an excel sheet every week. Before we had the "manual entry option", the table would be dropped and replaced by the excel version.
Now because there is data that only exists in the original table this can not be done.
I'm trying to find a way to update the original table with changes and additions from the (excel) table while preserving all rows not in the new sheet.
I've been attempting to simply use an insert query and an update query /but/ I can't find a way to detect changes in a record.
Any suggestions? I can provide the current sql if you'd find that helpful.
Based on what I have read so far, I think I can offer some suggestions:
It appears you have control of the MS Access. I would suggest adding a field to your data table called "source". Modify your form in the access database to store something like "m" for manual entry in the source field. When you import the excel, store an "e" for excel in the field.
You would need to do a one time scrub of the data to mark existing records as manual entries or excel entries. There are a couple of ways you can do it through automation/queries that I can explain in detail if you want.
Once past these steps, your excel process is fairly simple. You can delete all records with source = "e" and then do a full excel import. Manual records would remain unchanged.
This concept will allow you to add new sources and codes and allow you to handle each differently if needed. You just need to spend some time cleaning up your old data. I think you will find it worth it in the end.
Good Luck.

Validate in excel before uploading to access

I am attempting to upload an Excel document into Access. I have used VBA to unhide all columns and rows and then delete columns and rows that are not being used. All of the worksheets upload into Access properly except one. This particular worksheet attempts to upload a field and label it Field 12. I am unable to find a way to delete this field. Any help?
It is probably the first column after your data...
Try either in VBA or in Excel deleting the columns to the right of your data (not just contents but an actual delete). I've found this typically happens when the columns to the right of your data contained data at one point and Access / Excel sees those as still containing data. Then try your import again.
Alternatively, you could upload into a new Access staging table before pulling your desired known columns into the final table through an INSERT query. Then you can delete the staging table if you like or delete it before the next import. In this way, each import can have its own "added columns".

How to rearrange data from excel?

I have data in a spreadsheet which I have to upload in sql. The problem is that this data is quite crude. I need to rearrange the sheets in the excel file in terms of their relation with eachother. The first sheet has master data a colum of this sheet is to be linked to data in the other sheet. All I have is a sheet in which data is embedded. The relation between data is displayed using an expander button. Please tell me how I can rearrange this data fast? I think this can be done by running sql queries or ssis package but I'm not sure.
You can use SSIS package with multiple Source components (inside Data Flow) to access each sheet.
Once you can see both sources, you can sort all key columns using a sort component and then use a Merge Join to combine the two sets of data together