Forum Discussion
mb0307
4 years agoResponsive Resident
Concatenate single column
Hi all, I want to concatenate all values in a column with " prefix and suffix and , Example: Column1 3000 2000 7777 I want result to be: "3000", "2000", "7777" I will be using th...
- 4 years ago
Found solution:
{Cube.ApplyParameter, "[!V99]", {"""" & Text.Combine(TableName[ColName],""", """) & """" }}
Anonymous
4 years agoNot applicable
mb0307
Try the following code.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUorViVYyNjAwADPAhBEKzxwIlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Filtered Rows" = Table.SelectRows(Source, each ([Column1] <> "")),
#"Added Custom" = Table.AddColumn(#"Filtered Rows", "Custom", each """"&[Column1]&""""),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column1"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns"),
#"Merged Columns" = Table.CombineColumns(#"Transposed Table",{"Column1", "Column2", "Column3"},Combiner.CombineTextByDelimiter(",", QuoteStyle.None),"Merged")
in
#"Merged Columns"
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
mb0307
4 years agoResponsive Resident
Anonymous Thanks but if you see my post then I do not want to create a merged column.
I am looking to insert concatenate in the code here
{Cube.ApplyParameter, "[!V99]", {{ Text.Combine(CODE TO COMBINE ALL ROWS WITH ""}}},
so the text passed to source system looks like this (WITH ""s):
"3000", "2000", "7777"
Thanks