Sort list in a particular format

Please fins attached image

Reorder list could be what you are looking for

Alternate option using transpose

get all familt types in model.dyn (340.2 KB)

for your ref

Amigo @pics.munmun buenas. pay close attention to what you are trying to format, if your original lists do not have the same number of items when you run the transpose, it will generate nulls, which translates into empty cells when you open it in excel, I guess you want to export lists of certain families with their corresponding types and you want to get a rectangular table even though not necessarily all families have the same number of family types, am I right?

Hi @Mike.Buttery and @gilberto.arechigaiba
Thank you for your response.
Please find attached for your reference.
I want to combine two list.

Amigo @pics.munmun buenas. this topic of list could be mind blow at the begining, it is very difficult to assembly a fix and clean list to export and play with levels i always says is like the path to the dark side,
each list in a 2 leves list it is a row in excel i let you an example i hope this helps you!!

Excel data is structured by row. Each sublist represents the ordered row and each item in that sublist represents the cell at that column index. Understanding the required structure makes things much easier.

If you’re managing your data in columns that means you’ll need to transpose before sending to Excel. As Gilberto mentioned, if you transpose columns with irregular lengths then you’ll get nulls or unfinished lists. To avoid this, you need to pad your lists with empty cells based on your longest sublist. Then, when you transpose the padded lists, you’ll have equal dimensions that align with your new rows.

1 Like

I prefer CSV which can handle nulls and is vendor agnostic. Part of the original issue is the interleaving of the family and type columns which has then added how to handle uneven ‘ragged’ data. Transpose is your friend here as it fills in with nulls to keep column structure.

There are many ways to slice and dice the info however at the end you will require a 2-dimensional array where each list is a row of information. Using list levels is key

1 Like

Nice post my friend Solution like a pro!! :metal: :sunglasses:

1 Like