I want to dynamically convert stacked tables of key-value pairs into a single key-value table.
The input table has hundreds of key value pair tables stacked on top of each other. Every table has 3 columns.
I tried using a healper column with this formula, but it's not feasible in my case.
={ {"Key", "Value"}; { FLATTEN( FILTER(A2:C,D2:D="Key")), FLATTEN( FILTER(A2:C,D2:D="Value")) }}
CodePudding user response:
try:
={"Key", "Value"; FLATTEN(FILTER(A2:C, ISEVEN(ROW(A2:A)))),
FLATTEN(FILTER(A2:C, ISODD(ROW(A2:A))))}
or:
={"Key", "Value"; FLATTEN(QUERY(A2:C, "skipping 2", )),
FLATTEN(QUERY(A3:C, "skipping 2", ))}