Forum Discussion
domtrump
Helper II
2 years agoPass parameter from Cell(s)
Is there some way to pass a parameter to PQ from a value in a cell in the spreadsheet? Or prompt the user for values at runtime? Further, I used to use a tool when I worked with DB2 that would tak...
domtrump
Helper II
1 year agoHmmm. Not totally sure I follow. Let's say my source table looks like this:
My query to selct a subset of CustomerIDs would look like this (source is a query loading data from SQL Server)
Now I create a new table in Excel called ParmTable. The user pastes the desired list of CustomerIDs into this table.
This table has been loaded to PQ and then I right clicked it and hit Drill Down
So now how would I modify my query to use the list of parameters from ParmTable instead of a hardcoded list?
PwerQueryKees
Super User
1 year agoSqlQuery = "SELECT * FROM Sales where CustomerId in (" & Text.Combine(ParmTable, ",") & ")"