Hi,
I'm trying to come up with a jsl script which can find max value of each row and the column name corresponding to the max value. I was able to find the max value across all the columns but need some advice to find the column name corresponding to the max value
Here's the code:
Names Default To Here( 1 );
dt = Current Data Table();
dt << Select Columns( 2 :: 14 );
col = dt << Get Selected Columns( );
val = dt:MaxVal << get values( Format( "Best", 12 ) );
dt:Maximum Value << Set Formula( Max(col) );
nc = (N Items( col ));
For( j = 1, j <= N Items( val ), j++,
xxx = {};
For( i = 1, i <= nc, i++,
If( Contains( char(col[i]), val[j] ),
Insert Into( xxx, char(col[i]) )
)
);
Column( dt, 16 )[j] = xxx;
);