-
-
Save ImkeF/64753d27a9cf23e6e002c683db77453e to your computer and use it in GitHub Desktop.
Transforms all columns of a <code>table</code> with one <code>function</code> and one <code>type</code>.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let func = | |
(Table as table, Function, TypeForColumns as type, optional ColumnNames as list) => | |
let | |
columnNames = if ColumnNames = null then Table.ColumnNames(Table) else ColumnNames, | |
Transformation = Table.TransformColumns( Table, List.Transform(columnNames, each {_, Function, TypeForColumns} ) ) | |
in | |
Transformation , | |
documentation = [ | |
Documentation.Name = " Table.TransformAllColumns.pq ", | |
Documentation.Description = " Transforms all columns of a <code>table</code> with one <code>function</code> and one <code>type</code>. ", | |
Documentation.LongDescription = " Transforms all columns of a <code>table</code> with one <code>function</code> and one <code>type</code>. Optionial <code>ColumnNames</code> to limit to a specific list. ", | |
Documentation.Category = " Table ", | |
Documentation.Source = " www.TheBIccountant.com https://wp.me/p6lgsG-2dQ . ", | |
Documentation.Version = " 1.0 ", | |
Documentation.Author = " Imke Feldmann ", | |
Documentation.Examples = {[Description = " ", | |
Code = " TableTransformAllColumns( #table( {""TextColumn1"", ""TextColumn2""}, List.Zip( { {""123<code>456</code>"" ,""789<code>101</code>""}, {""ABC<code>DEF</code>"" ,""GHI<code>JKL</code>""} } ) ), fnRemoveHtmlTags, type text) ", | |
Result = " #table( {""TextColumn1"", ""TextColumn2""}, List.Zip( { {""123456"" ,""789101""}, {""ABCDEF"" ,""GHIJKL""} } ) ) "]}] | |
in | |
Value.ReplaceType(func, Value.ReplaceMetadata(Value.Type(func), documentation)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment