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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현