Column List Loop Start - two columns at a time.

I have a table that consist of columns containing pre-test and post-test data. There n pre-test columns and an equal number of post-test columns. I have the columns sorted so that pre-test item 1 is next to post-test item 1 and so on for the remaining columns. What I would like to do is select the first 2 columns do some analysis that will result in a new variable, then take the next 2 columns and do some analysis that will result in a new variable for that item. So I will end up (using the Loop End Column Append) with 1 new variable (the pre-post analysis) for each item.

I essentially need what the Column List Loop Start node does but I need to select 2 columns at a time instead of 1. Is there a nested loop solution for this? Any ideas appreciated. Thanks,


Hi Stephen,

quick and dirty solution: if you have your data sorted in this way you could transpose your dataset so that your columns become rows and then use a "Chunk Loop Start" node with Chunk size = 2 (i.e. always selecting a pre + post column pair). Within the loop you transpose the data again and compute your new variable (pre-post analysis) and then use a "Loop End (Column Append)" node so that you have your desired outcome dataset. Not very clean but should be quicker than implementing a nested loop.

Hope this helps,


Genius! That worked perfectly for what I was trying to do. Thanks!