Really informative. Thanks for sharing, I was thinking of another scenario in which we don't miss attributes but they are not in the same position. based on your amazing explanation this came to my mind for this scenario: = LAMBDA(attribute,value, LET( unique_attributes, UNIQUE(attribute), attribute_ids, SEQUENCE(ROWS(unique_attributes)), col_id, XLOOKUP(attribute, unique_attributes, attribute_ids), row_id, MAP(attribute, LAMBDA(a, COUNTIF(TAKE(attribute, 1):a, a))), pivoted, PIVOTBY(row_id, HSTACK(col_id, attribute), value, SINGLE,0,0,,0), DROP(pivoted, 1, 1) ) )
Thanks!
Really informative. Thanks for sharing, I was thinking of another scenario in which we don't miss attributes but they are not in the same position.
based on your amazing explanation this came to my mind for this scenario:
= LAMBDA(attribute,value,
LET(
unique_attributes, UNIQUE(attribute),
attribute_ids, SEQUENCE(ROWS(unique_attributes)),
col_id, XLOOKUP(attribute, unique_attributes, attribute_ids),
row_id, MAP(attribute, LAMBDA(a, COUNTIF(TAKE(attribute, 1):a, a))),
pivoted, PIVOTBY(row_id, HSTACK(col_id, attribute), value, SINGLE,0,0,,0),
DROP(pivoted, 1, 1)
)
)
Great stuff, but REALLY needs sample download, even with just the starting data.
Thanks, I'll need to find some time to make the files in a state fit for consumption.
That would make a nice 5G function 😃