Hi,
Thank you for the script. While it works amazingly for the table that I provided, I am having difficulty in making it work for my actual data set. Attached is the data set and below is the modified code. Could you please take a look:
Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt << get column names( string );
Summarize( dt, slotGroups = by( :Slot ) );
dt << select where( :Slot == slotGroups[1] );
dtTrans = dt << subset( selected rows( 1 ), selected columns( 0 ) );
For( i = 2, i <= N Items( slotGroups ), i++,
dt << select where( :Slot == slotGroups[i] );
dtTemp = dt << subset( selected rows( 1 ), selected columns( 0 ) );
For( k = 1, k <= N Cols( dtTemp ), k++,
Column( dtTemp, k ) << set name( colNames[k] || " " || Char( i ) )
);
dtTrans << Update( With( Data Table( "Subset of Original table 2" ) ) );
Close( dtTemp, nosave );
);