Forum Discussion
Custom Function Add column for each binary
- 4 years ago
Hi Anonymous
Your idea is doable. You can create a blank query and paste below code into it. This query will become a custom function which has a parameter paraContent requiring a binary value.
(paraContent as binary)=> let #"Imported Text" = Table.FromColumns({Lines.FromBinary(paraContent,null,null,1252)}), #"Extracted Text Before Delimiter" = Table.TransformColumns(#"Imported Text", {{"Column1", each Text.BeforeDelimiter(_, "|"), type text}}), #"Renamed Columns" = Table.RenameColumns(#"Extracted Text Before Delimiter",{{"Column1", "RecordType"}}) in #"Renamed Columns"Then in the initial query, click "Invoke Custom Function" beneath Add Column tab. In Invoke Custom Function window, select above function and select Content column for the paraContent parameter.
In the new column, you will have a table value in each cell. This table value is the result of the custom function.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi Anonymous
Your idea is doable. You can create a blank query and paste below code into it. This query will become a custom function which has a parameter paraContent requiring a binary value.
(paraContent as binary)=>
let
#"Imported Text" = Table.FromColumns({Lines.FromBinary(paraContent,null,null,1252)}),
#"Extracted Text Before Delimiter" = Table.TransformColumns(#"Imported Text", {{"Column1", each Text.BeforeDelimiter(_, "|"), type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Extracted Text Before Delimiter",{{"Column1", "RecordType"}})
in
#"Renamed Columns"
Then in the initial query, click "Invoke Custom Function" beneath Add Column tab. In Invoke Custom Function window, select above function and select Content column for the paraContent parameter.
In the new column, you will have a table value in each cell. This table value is the result of the custom function.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.