Hello! I’ve been searching the forums to find a solution to my issue but I haven’t found one. If this question has been answered already, please point me to it.

Put simply, I have a dataset where 12 fields are being produced as rows rather than as columns. Meaning that the row count is many times larger than it should be. But the order is consistent. So I’d like a new column numbering the rows 1-12 in sequence to aid with pivoting them into columns. Essentially:

I suspect that a loop will be the solution. Since I know the final row count will be divisible by 12, it should be easy to calculate that into the total number of loops required and enter that as a flow variable. But I haven’t been able to figure out how to make the whole thing work. Hopefully, this all makes sense.

Thank you very much in advance. I hope the answer isn’t too embarrassingly obvious!
Cam

Hi @CKillick
If I understand you right, I think this will achieve what you need.

First Identify the x number of total rows
Divide it by 12 for the count number (y=x/12)
First a Loop y times through it using counting LoopStart.
Second a chunk LoopStart with a chunk of 12 through it.
Then a RowID, a transpose node and then two loop ends

Thank you both! I believe either of these solutions would work but I find the math formula a bit easier to deploy so I’ll probably proceed with that. But I’m glad that the solution was indeed simple.