Conditional splitting and recombining in new order

I frequently need to move some special rows into a different location which is basically splitting and recombining in an different order.
BUT: if the special markers are not present (condition false) the list should stay untouched
For example like:

I intended to create a new column “parts” which I could filter into four different lists to re-stack them in the desired order ( like in the right example )

Not sure though how to create the parts column in the above way.
And possibly, there are number of much smarter ways to achieve the goal?

Any advice? Or is this a missing transform in EDT? Like a conditional slice which leaves the list alone when in non-matching case

It should be possible to do this by using Slice to cut out the 3 sections (one of which may be empty) and then recombine them in the new order. However it seems that Slice with Mode=Remove passes the dataset empty if there is no match, while it should return the whole dataset. I will look into that.

I came up with a way to do it without Slice. It is pretty ugly though.

reordering.transform (4.1 KB)

Wow. :tada: Thank you! At least a possibility. hadn’t thought of the “total” transform.
( But you are right: looks like an ugly backdoor tweak. )

Hope there will be a smoother way, once you have fixed slice to not loose data. Looking forward to this :slight_smile:

1 Like

We have fixed Slice to leave the input data unchanged if the first or last rows are unmatched when Mode is set to Remoce. This fix will be in the next release. Note that this could affect existing .transform files.

1 Like

that sounds like good news :tada:

See item 2 in this snapshot release:

Please let me know if it works ok for you.