Forum Discussion
can we execute all sql script in power query at once?
- Anonymous4 years ago
Hello ImkeF ,
Thank you for your clarification. Let me share my experiance on this query.
After I did some research I found one solution to my problem.
that is called get data from query id (single line)
Let me explain it briefly
1. There are multiple tables and conditions used in my code which is around 200 lines of code but I want the last 2 tables individually.
2. I have run the entire code (exept the last two tables)
3. once I run the table 1 once query id will generate so That is my keypoint
4. select last_query_id(-1) -- to get the query id
4. selct * from table (result_scan('Table1 QUERY ID')); - Entered this in power query sql code space and got the resulsts.
This is my story about my answer- self learning gives me a lot of satisfaction.
Thank you!
Hello Anonymous ,
yes, if you just expect one output table, you can write all your logic in one query.
In a query, every step name is like a variable. So you can create staging logic in certain steps and reference each step from whereever you need.
But if you want to create multiple queries at one go, this is not possible with a custom script.