List combine item at index [2] with item at index [1]

Situation: Creating a export to Excel with the family parameters. By the flatten of the list string with the breaking point “:”. Now an family has a nested family. So there is an extra item because of the breaking point. See at List 219.

Question: How can I combine all the items at index [2] to combine with item of index [1].

Hi @snnybsch ,

you could do it with this definition :

def combine(list : var[])
out = DSCore.List.Count(list) == 3 ? {list[0],list[1]+list[2]} : list;
return = out;

Or like this :

1 Like