Adding spacer rows

Hello

I’m currently optimizing a large workflow on 5.2.5 and one “performance hog” is a group loop with 2700 iterations.

What it does is adding a spacer row for easier readability:

We’re doing a Group By followed by Concatenate:

The intervals are random, so we can’t just add an empty row every X rows.

We also want the row to keep the value of 7 columns:
SO No
SO Type
SO Line
Code
Confirm Code
Sort
SP Date

Any help is appreciated :smiley:

Hi @rkehrli , I can see that would impact performance.

Can you try this pattern:

Basically give every row a unique counter value
Do a group by on entire dataset, grouping by all your grouping columns

For the “groupby” output table, create a new constant value column called “Counter” that has a very high value of say 99999999

Concatenate groupby output with original data set. Sort by the groupings and Counter to assemble rows in desired order, and after that tidy up your data set as you require (e.g. remove the Counter column, or use the “99999999” counter value to identify your “group totals” rows and do something with them, like blanking out specific columns or whatever.

example:

3 Likes

Hi @takbb

This worked like a charm, my “senior” just went off to vacation, he’s going to be very happy when he gets back :smiley:

Get’s a bit hard sometimes to think outside the box.

3 Likes

Great. Glad it worked for you, and hope your “senior” enjoys their vacation :slight_smile: Thanks for marking the solution!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.