Create a loop to add column properties to columns that contain a specific headerHello,
Being still new with JSL, I'm still struggling with the implementation of certain concepts namely looping.
Any way, I'm trying to create a script which would add to any column in a table in which the header contains "Norm" a number of specific column properties.
dt=current data table();
a = "Norm";
col = dt << get column names( string );
nc = N Items( col );
For( i = 1, i <= nc, i++,
If( Contains( col[i], a ),
col[i]<<ADD column="" properties=""></ADD>
Unfortunately, I'm clearly missing something fundamental and the script is not going anywhere.Some guidance would be greatly appreciated.
Thanks
Sebastien
Re: Create a loop to add column properties to columns that contain a specific headerWorked like a charm.
Thanks a lot for the very rapid suggestion.
Much appreciatedRe: Create a loop to add column properties to columns that contain a specific headerSee if this is what you want
Names Default To Here( 1 );
dt = Current Data Table();
a = "Norm";
col = dt << get column names( string );
nc = N Items( col );
For( i = 1, i <= nc, i++,
If( Contains( col[i], a ),show(col[i]);
column(col[i]) << Set Property( "Axis", Add Ref Line( 200, "Dotted", "Red", "", 2 ) )
)
);