Powerquery to SQL using Cell value as parameter very slowSet a default parameter value for a JavaScript functionDoes Java support default parameter values?Excel 2003 send date parameters to SQL queryGet url parameter jquery Or How to Get Query String Values In jsSQL: Parameters from excel generate error: String data, right truncationExcel Input Parameters queryPowerQuery - Using a cell in a table as part of the code in a query (dynamically or not)Excel Query Parameter Update when Cell Value ChangesReplace SQL query parameter in a Excel power queryCell reference to a powerquery

Have powerful mythological heroes ever run away or been deeply afraid?

Why is Colorado so different politically from nearby states?

Story about a toddler with god-like powers, dangerous tantrums

Is it possible to kill all life on Earth?

Is it legal in the UK for politicians to lie to the public for political gain?

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

How can Iron Man's suit withstand this?

If a problem only occurs randomly once in every N times on average, how many tests do I have to perform to be certain that it's now fixed?

If Sweden was to magically float away, at what altitude would it be visible from the southern hemisphere?

How should I push back against my job assigning "homework"?

Hygienic footwear for prehensile feet?

Is there a rule that prohibits us from using 2 possessives in a row?

Rotated Position of Integers

Is there any Biblical Basis for 400 years of silence between Old and New Testament?

Humans meet a distant alien species. How do they standardize? - Units of Measure

Asking bank to reduce APR instead of increasing credit limit

Working in the USA for living expenses only; allowed on VWP?

What is the correct expression of 10/20, 20/30, 30/40 etc?

Imperfective Aspect in German "not since" constructions

How can I offer a test ride while selling a bike?

How can a single Member of the House block a Congressional bill?

Get value of the passed argument to script importing variables from another script

What's the most polite way to tell a manager "shut up and let me work"?

How to provide realism without making readers think grimdark



Powerquery to SQL using Cell value as parameter very slow


Set a default parameter value for a JavaScript functionDoes Java support default parameter values?Excel 2003 send date parameters to SQL queryGet url parameter jquery Or How to Get Query String Values In jsSQL: Parameters from excel generate error: String data, right truncationExcel Input Parameters queryPowerQuery - Using a cell in a table as part of the code in a query (dynamically or not)Excel Query Parameter Update when Cell Value ChangesReplace SQL query parameter in a Excel power queryCell reference to a powerquery






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















scenario:




Running an XL sheet, using a single powerquery to retrieve data from a SQL server. The resulting dataset gets used in two subqueries. All three datasets are then loaded to pivot tables in the XL sheet.



objective:




Send query using 2 parameters retrieved from XL sheet, thereby reducing size of returned dataset. Folding query back onto SQL server, rather than filter post-retrieval in PQ.



description of problem:




if I use the below configuration for the main query:



let
dbQuery = "SELECT * FROM dbo.somequery",
Source = Sql.Database("<server>", "<database>", [Query=dbQuery])
in
Source


This works fine and returns about 6500 rows almost instantly.



The following function is defined as 'GetRange' in PQ to retrieve a cell value:



(rangeName) => 
Excel.CurrentWorkbook()[Name=rangeName][Content]0[Column1]


Two parameters get retrieved by using below syntax for each:



= GetRange("<named cell>")


If I now change the dbQuery to:



dbQuery = "SELECT * FROM dbo.xlPAS_PivotOutput 
WHERE parameter1=" & Text.From(parameter1) & " and parameter2=" & Text.From(parameter2),


The query does compile, and results are returned, but Excel PQ takes about 1 to 2 minutes to actually return a value?
It appears that simply retrieving the 2 cell values and using them as input parameters takes a huge effort for some reason ?










share|improve this question






















  • Do you see the same slowdown if you put the parameters directly into your query? If you ignore privacy levels for your document (from Options | Current Workbook | Privacy), does the query speed up?

    – Alejandro Lopez-Lago - MSFT
    Apr 3 at 23:51











  • @AlejandroLopez-Lago-MSFT, Many thanks for your reply. If I put the values directly in query no problem, quick response. Only when values get read from the sheet there is a problem. Privacy settings are set to ignore, no difference there...

    – mtholen
    Apr 5 at 15:27


















0















scenario:




Running an XL sheet, using a single powerquery to retrieve data from a SQL server. The resulting dataset gets used in two subqueries. All three datasets are then loaded to pivot tables in the XL sheet.



objective:




Send query using 2 parameters retrieved from XL sheet, thereby reducing size of returned dataset. Folding query back onto SQL server, rather than filter post-retrieval in PQ.



description of problem:




if I use the below configuration for the main query:



let
dbQuery = "SELECT * FROM dbo.somequery",
Source = Sql.Database("<server>", "<database>", [Query=dbQuery])
in
Source


This works fine and returns about 6500 rows almost instantly.



The following function is defined as 'GetRange' in PQ to retrieve a cell value:



(rangeName) => 
Excel.CurrentWorkbook()[Name=rangeName][Content]0[Column1]


Two parameters get retrieved by using below syntax for each:



= GetRange("<named cell>")


If I now change the dbQuery to:



dbQuery = "SELECT * FROM dbo.xlPAS_PivotOutput 
WHERE parameter1=" & Text.From(parameter1) & " and parameter2=" & Text.From(parameter2),


The query does compile, and results are returned, but Excel PQ takes about 1 to 2 minutes to actually return a value?
It appears that simply retrieving the 2 cell values and using them as input parameters takes a huge effort for some reason ?










share|improve this question






















  • Do you see the same slowdown if you put the parameters directly into your query? If you ignore privacy levels for your document (from Options | Current Workbook | Privacy), does the query speed up?

    – Alejandro Lopez-Lago - MSFT
    Apr 3 at 23:51











  • @AlejandroLopez-Lago-MSFT, Many thanks for your reply. If I put the values directly in query no problem, quick response. Only when values get read from the sheet there is a problem. Privacy settings are set to ignore, no difference there...

    – mtholen
    Apr 5 at 15:27














0












0








0








scenario:




Running an XL sheet, using a single powerquery to retrieve data from a SQL server. The resulting dataset gets used in two subqueries. All three datasets are then loaded to pivot tables in the XL sheet.



objective:




Send query using 2 parameters retrieved from XL sheet, thereby reducing size of returned dataset. Folding query back onto SQL server, rather than filter post-retrieval in PQ.



description of problem:




if I use the below configuration for the main query:



let
dbQuery = "SELECT * FROM dbo.somequery",
Source = Sql.Database("<server>", "<database>", [Query=dbQuery])
in
Source


This works fine and returns about 6500 rows almost instantly.



The following function is defined as 'GetRange' in PQ to retrieve a cell value:



(rangeName) => 
Excel.CurrentWorkbook()[Name=rangeName][Content]0[Column1]


Two parameters get retrieved by using below syntax for each:



= GetRange("<named cell>")


If I now change the dbQuery to:



dbQuery = "SELECT * FROM dbo.xlPAS_PivotOutput 
WHERE parameter1=" & Text.From(parameter1) & " and parameter2=" & Text.From(parameter2),


The query does compile, and results are returned, but Excel PQ takes about 1 to 2 minutes to actually return a value?
It appears that simply retrieving the 2 cell values and using them as input parameters takes a huge effort for some reason ?










share|improve this question














scenario:




Running an XL sheet, using a single powerquery to retrieve data from a SQL server. The resulting dataset gets used in two subqueries. All three datasets are then loaded to pivot tables in the XL sheet.



objective:




Send query using 2 parameters retrieved from XL sheet, thereby reducing size of returned dataset. Folding query back onto SQL server, rather than filter post-retrieval in PQ.



description of problem:




if I use the below configuration for the main query:



let
dbQuery = "SELECT * FROM dbo.somequery",
Source = Sql.Database("<server>", "<database>", [Query=dbQuery])
in
Source


This works fine and returns about 6500 rows almost instantly.



The following function is defined as 'GetRange' in PQ to retrieve a cell value:



(rangeName) => 
Excel.CurrentWorkbook()[Name=rangeName][Content]0[Column1]


Two parameters get retrieved by using below syntax for each:



= GetRange("<named cell>")


If I now change the dbQuery to:



dbQuery = "SELECT * FROM dbo.xlPAS_PivotOutput 
WHERE parameter1=" & Text.From(parameter1) & " and parameter2=" & Text.From(parameter2),


The query does compile, and results are returned, but Excel PQ takes about 1 to 2 minutes to actually return a value?
It appears that simply retrieving the 2 cell values and using them as input parameters takes a huge effort for some reason ?







excel parameters powerquery






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 12:22









mtholenmtholen

506412




506412












  • Do you see the same slowdown if you put the parameters directly into your query? If you ignore privacy levels for your document (from Options | Current Workbook | Privacy), does the query speed up?

    – Alejandro Lopez-Lago - MSFT
    Apr 3 at 23:51











  • @AlejandroLopez-Lago-MSFT, Many thanks for your reply. If I put the values directly in query no problem, quick response. Only when values get read from the sheet there is a problem. Privacy settings are set to ignore, no difference there...

    – mtholen
    Apr 5 at 15:27


















  • Do you see the same slowdown if you put the parameters directly into your query? If you ignore privacy levels for your document (from Options | Current Workbook | Privacy), does the query speed up?

    – Alejandro Lopez-Lago - MSFT
    Apr 3 at 23:51











  • @AlejandroLopez-Lago-MSFT, Many thanks for your reply. If I put the values directly in query no problem, quick response. Only when values get read from the sheet there is a problem. Privacy settings are set to ignore, no difference there...

    – mtholen
    Apr 5 at 15:27

















Do you see the same slowdown if you put the parameters directly into your query? If you ignore privacy levels for your document (from Options | Current Workbook | Privacy), does the query speed up?

– Alejandro Lopez-Lago - MSFT
Apr 3 at 23:51





Do you see the same slowdown if you put the parameters directly into your query? If you ignore privacy levels for your document (from Options | Current Workbook | Privacy), does the query speed up?

– Alejandro Lopez-Lago - MSFT
Apr 3 at 23:51













@AlejandroLopez-Lago-MSFT, Many thanks for your reply. If I put the values directly in query no problem, quick response. Only when values get read from the sheet there is a problem. Privacy settings are set to ignore, no difference there...

– mtholen
Apr 5 at 15:27






@AlejandroLopez-Lago-MSFT, Many thanks for your reply. If I put the values directly in query no problem, quick response. Only when values get read from the sheet there is a problem. Privacy settings are set to ignore, no difference there...

– mtholen
Apr 5 at 15:27













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323757%2fpowerquery-to-sql-using-cell-value-as-parameter-very-slow%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323757%2fpowerquery-to-sql-using-cell-value-as-parameter-very-slow%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript