Forum Discussion
l1800turbo
3 years agoRegular Visitor
Adding column values from other table for empty cells
Hello, I'm building a table where I fetch data from an SQL database. In this table some values are empty (=null). For these empty cells I want to add values from another table, but they should o...
wdx223_Daniel
3 years agoCommunity Champion
if the table of Simulation_Database_TSA_tmp is unique in the column of MatNr, then
TSA_DB_Add3=let a=Table.Buffer(Simulation_Database_TSA_tmp) in Table.FromRecords(Table.TrandformRows(TSA_DB_Add2,each Record.TransformFields(_,List.Transform(TSA_Columns,(x)=>{x, each Record.FieldOrDefault(a{[MatNr=[MatNr]]}? ??[],x,null)}),2)))
if not, then
TSA_DB_Add3=let a=Table.Buffer(Table.Group(Simulation_Database_TSA_tmp,"MatNr",{"n",each _{0}})) in Table.FromRecords(Table.TrandformRows(TSA_DB_Add2,each Record.TransformFields(_,List.Transform(TSA_Columns,(x)=>{x, each Record.FieldOrDefault(a{[MatNr=[MatNr]]}?[n]? ??[],x,null)}),2)))