Forum Discussion
Use Table header as the column name in a merge query
I want to use the Table header value as the column name in a merge query I have (from a previous question)
#"Merged Columns" = Table.CombineColumns(#"Trimmed Text",mergeHeaders[headers],Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"Merged")
I have tried replacing Merged with mergeHeaders[headers] but get the error
Expression.Error: We cannot convert a value of type List to type Text.
Details:
Value=[List]
Type=[Type]
I have also tried mergeHeaders[headers]{0} I get no error but the merge no longed outputs data
Thank you
Use this in place of mergeHeaders[headers]
Text.BetweenDelimiters("mergeHeaders[headers]","[","]")Note - For this merge to work, you require at least 2 column names which exist in #"Trimmed Text". This result should appear in the place where you would place this. Refer the doc here - https://docs.microsoft.com/en-us/powerquery-m/table-combinecolumns
2 Replies
- Vijay_A_Verma
Most Valuable Professional
Use this in place of mergeHeaders[headers]
Text.BetweenDelimiters("mergeHeaders[headers]","[","]")Note - For this merge to work, you require at least 2 column names which exist in #"Trimmed Text". This result should appear in the place where you would place this. Refer the doc here - https://docs.microsoft.com/en-us/powerquery-m/table-combinecolumns
- AnonymousNot applicable
Yes, that's great! Thank you again