Running multiple SQL queries

Hi all,

I am wondering if there is a better “housekeeping” method than what I am currently doing. I am using data from elasticsearch and when I start working with a certain dataset by running SQL queries on it, the SQL editor gets very cluttered after the first query. I am usually applying 3-6 queries before I am ready to export this to Tableau. Currently, I am having to run a SQL query and then “save-as” the dataset which ends up leaving me with multiple virtual datasets that are reliant on each other. It seems that this would be easily fixed if I could just “save” the dataset while working on it and it cleared the SQL editor.

How is everyone navigating around this issue?

Sorry, I’m having a hard time understanding what you’re doing exactly and what the issue is you’re trying to address.

When you say “export this to Tableau”, what do you mean?

Maybe you could walk through the scenario, like what you do with your 3-6 queries and how you’re using Tableau.

Also, after you create a VDS, you can edit the VDS rather than saving a new VDS. Perhaps this is what you’re looking for?

So lets say I am working with dataset “x” from ElasticSearch. When I open that in Dremio and make an edit (lets say I query one column for all instances where the words “Have a nice” appear) I then save this and it creates a virtual dataset. If I go back into the virtual dataset (by clicking the drop down menu and clicking “Edit”) the SQL editor still shows the last query instead of “Select * FROM “table_name””.

I am doing multiple queries on each dataset (excluding certain items, renaming columns, sorting, etc) and the SQL editor ends up being way too cluttered to accurately see what I am doing. My work around is to run a query, save the virtual dataset, open it (not edit) make changes to it and then “Save As”. The issue with this is I have 4-5 virtual datasets for each “project” I am trying to accomplish and it seems unnecessary instead of just being able to actually “Save” my work and not have to parse through all of the old SQL commands I made.

Are you wanting to work off the same VDS each time? That is, run your multiple queries on the one VDS without having to create several different ones? This is possible by simply editing/saving to the same VDS each time you add SQL queries via the editor. Then you can simply connect to Tableau via the .tds connector file.

Yes, this is what I would like to do. I want to be able to work off the same VDS and apply multiple queries. When you are adding queries via the SQL editor, are you just adding queries on top of other queries? This is what I am trying to avoid. I think it would make much more sense to me as I am not an advanced SQL user.
Having to parse through 8-9 lines of SQL queries seems unnecessary when they have already been applied and should just be saved as part of that VDS. Hopefully I am explaining the issue correctly :slight_smile:

Seems you could add all queries at once via the SQL editor and save the VDS or add and apply them one-at-a-time to the same VDS (saving the same VDS each time). In the latter case the queries would be additive each time you save to the VDS.

Okay, this is what I was afraid of. Thanks for the clarification!