+ Reply to Thread
Results 1 to 4 of 4

Power Query Editor SQL - use query results in SQL

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Power Query Editor SQL - use query results in SQL

    Hi All.

    I got an answer from this forum on my previous post... Now I need to continue to advance.

    I would like to add the results of a query to my SQL. By Filtering the results in the SQL, It runs much faster.

    Last post I asked and learned how to add an excel range to my sql in the advanced editor. Now I want to add the results of a query in my sql..
    Last post I learned to ...
    Please Login or Register  to view this content.
    Now I want the results of POWER query (named "PN Listing") to be used instead of excel_range_creator_to_include - excel range can not be larger than 100 rows... I am guessing below
    Please Login or Register  to view this content.
    what is the syntax needed for the line power_query_results_to_include = "'" & ---- PowerQuery("PN Listing")--------- & "'",

    Thanks.
    Steve
    Harrisburg, PA
    Last edited by Steveapa; 08-13-2019 at 03:10 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Power Query Editor SQL - use query results in SQL

    So you want to use PQ result to your IN statement list?

    Lets say that your query for the list is named myQuery, and has column named PN.
    You'd then use Text.Combine, much like what you did with Excel list.
    Please Login or Register  to view this content.
    Note that doing so, will create query dependency and depending on data security settings, you may get Formula Firewall error. If that is encountered, you can deal with it in 2 ways.

    1. By combining 2 queries into single query.
    2. By setting data security level for both queries to be same (ex. both set to Organizational level security).
    Last edited by CK76; 08-13-2019 at 01:40 PM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Re: Power Query Editor SQL - use query results in SQL

    Awesome. this is the 2nd time you helped me.

    PS, I quote Robert A. Heinlein all the time now.

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Power Query Editor SQL - use query results in SQL

    You are welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 23
    Last Post: 12-15-2022, 05:14 AM
  2. Locking rows with Power Query Editor
    By hydrostation in forum Excel General
    Replies: 6
    Last Post: 08-02-2019, 09:57 AM
  3. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  4. Power Query Editor is Non-Responsive
    By lsloman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2019, 08:23 PM
  5. [SOLVED] Power Query results to a .csv file
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2019, 02:39 AM
  6. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  7. [SOLVED] power query editor - unpivot?
    By pccamara in forum Excel General
    Replies: 5
    Last Post: 09-07-2016, 10:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1