I'm trying to list available categories of columns based on the first 3 letters of the column title. I can list all the available values readily but I have many duplicates. Summarize doesn't obviously work for anything but a list of columns and what I have is a list of initials. I tried this with no luck. Any help appreciated.
dt = Current Data Table();
dt << Clear Column Selection();
colList = dt << get column names( string );
found_list={};
For( i = 1, i >= N Items( collist ), i++,
Spud = Char(Munger( Head Name( As Namespace( colList[i] ) ), 0, 3 ));
If( !Contains(found_list), Spud, insert into(found_list, Spud ))
);
Show(found_list);
Does this get you any further along
names default to here(1);
dt =
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
colList = dt << get column names( string );
for each({col,index}, colList,
colList[index] = substr(col,1,3)
)
grps = associative array(colList)<<get keys;
It returns all of the unique 3 letter names
Does this get you any further along
names default to here(1);
dt =
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
colList = dt << get column names( string );
for each({col,index}, colList,
colList[index] = substr(col,1,3)
)
grps = associative array(colList)<<get keys;
It returns all of the unique 3 letter names
Thanks Jim. There's a ; missing but works well.