Forum Discussion
CapitateAle
Sep 13, 2023Copper Contributor
Adding Column based on a List and results of costum function
Good Morning I've a Table called Score_Dati_Bilancio in witch i would like to execute this function: let Fx_Calcola_Score = (Nome_Colonna,Colonna_Indicatore, Settore) =>
let
Min_Colonna...
SergeiBaklan
Sep 13, 2023Diamond Contributor
Perhaps it's better with recursion. Function could be like
fn = ( lst as list, tbl as table) =>
if List.Count(lst) = 0
then tbl
else @fn( List.Skip(lst),
let
current = lst{0},
Min_Colonna = "Min_"& current{0},
// next steps
t = finalStep
in t
),
where lst is you list of lists. Instead of single list parameters you use current for the single list in iteration and when current{0}, current{1}, current{2} where applicable.
Function is called as fn( listOfLists, tableToTransform)