Stack multiple cost and description columns

Hi there, I have a table that has multiple cost and description columns:

I am trying to derive a table that would essentially stack each charge amount and description into one column and repeat the first column (Master Tracking) for each pair of amount and description. Is there a way to do this in easymorph?

Hi Ajesh and welcome to the Community!

You can select groups of columns in derived tables and then append (stack) them using the “Append” action. Note that to stack two columns in two tables, they should have the same name.

See the example below.

stack-columns.morph (5.0 KB)
Book2.xlsx (8.8 KB)

Thanks for this! One more question, there are about 25 columns for each of these, would I have to derive tables for each pair? Wanted to see if there was a more efficient way, but happy to go this route if not as well.

There is a more efficient way via unpivoting and re-pivoting. But it’s less straight-forward.

Here you go. See tab “Method 2”.

stack-columns.morph (7.4 KB)

1 Like