Skip to content

Latest commit

 

History

History

fnFjoAddColCheckAll

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

fnFjoAddColCheckAll

version Excel template versionversion

Add a new column CHECK_ALL (default value) to quickly check if there are difference or not.

function (inputTable as table, listCheckedColumns as list, optional newColumnName as text) as table

Description

Add a new column CHECK_ALL (default value) to quickly check if there are difference or not.

Code

let
    Fonction = (TableInput as table, ListFields as list, optional inputNewColumnName as text) =>
    let
        StrNewcolName = if inputNewColumnName <> null then inputNewColumnName else "CHECK_ALL",
        ListCheckedFields = List.Accumulate(ListFields, {}, (acc, val) => List.InsertRange(acc, List.Count(acc), {"CHECK_" & val})),
        New_Col_CHECK_ALL = Table.AddColumn(TableInput, StrNewcolName, each if Text.Contains(List.Accumulate(ListCheckedFields, "", (acc, val) => Text.Combine({acc, Record.Field(_, val)})), "|") then "KO" else "OK", type text)
    in
        New_Col_CHECK_ALL
in
    Fonction