Delink and relink worksheets
Hi All,
I have a workbook with a SQL sheet referencing Sheet1 ( codes refer to columns in Sheet1 as Sheet1.var1, Sheet1.var2,.,). I had make certain changes in the workbook by joining Sheet1 and another sheet (by default creating the Joined Sheet). The SQL sheet should now reference the joined sheet. currently I am taking the copy of the codes into a notepad and replace all Sheet1 reference to Joined and then re-execute the same. IS there a way to automatically link the sql sheet to the joined sheet.
Thanks for taking time out to view this post and appreciate your response on this.
-
Hello Ganesh.
When you write queries for Datameer SQL Worksheets you should consider every Sheet in a Workbook as a table.For example
- A Workbook has Sheet1 and Sheet2.
- You create a SQL Sheet and introduce there a query e.g. SELECT col1, col2 FROM Sheet1.
- Then you Join Sheet1 and Sheet2 - this will result in creating a new Sheet - Joined.
- Joined is a completely new Sheet in the Workbook. At the same time, Sheet1 steel exists in the Workbook and the query in the SQL Sheet is still valid.
If now you want to query data from Joined Sheet instead of Sheet1, you should either create a new SQL Sheet or write a new query for the existing one.
Like in SQL you need to change your query to use a different table as a source, in Datameer's SQL Sheet you need a new query as well. There is no option to automatically "repoint" an existing SQL Sheet.
As an option for saving time while building Workbooks, I could suggest plan a Workbook's structure in advance. E.g. in case, you need query data from a Joined Sheet, do you really need to create a SQL sheet and query from Sheet1 before this?
Do not hesitate to let me know if you have any further questions.
Please sign in to leave a comment.
Comments
1 comment