0

I am trying to make my power query more dynamic, currently I request my data using a stored procedure including part-no parameter that I hard-code into my query

EXEC GSCM_Staging.dbo.top_N_BOM 
    @Top_Parts = 'GL158K380G03|GL302K479G02|GL825R339G06|GL825R367G03|GL212R585G06'

I already have the individual part numbers in a list from a table in Excel

enter image description here

How would I go about converting this column with 4 rows into a column with a single pipe delimited row (Like the one used in my SQL query)

1

1 Answer 1

2

Fairly easy

Beginning from your Source table

  1. first convert the table to list

    ListOfParts = Source[TOP_PART]
    
  2. then concatenate the list into delimited text

    JoinedText = Text.Combine(ListOfParts, "|")
    
  3. further modify it if required

    PartsFilter = "'" & JoinedText "'"
    

In short

let
    Source = Table.CurrentWorkbook.....
    ListOfParts = Source[TOP_PART]
    JoinedText = Text.Combine(ListOfParts, "|")
    PartsFilter = "'" & JoinedText "'"
in PartsFilter
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.