Forum Discussion
domtrump
2 years agoHelper II
Pass 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
1 year agoHelper II
Hmmm. 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
1 year agoSuper User
SqlQuery = "SELECT * FROM Sales where CustomerId in (" & Text.Combine(ParmTable, ",") & ")"