- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Categorise Columns by initials
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);
Slán
SpannerHead
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Categorise Columns by initials
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
Jim
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Categorise Columns by initials
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
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Categorise Columns by initials
Thanks Jim. There's a ; missing but works well.
Slán
SpannerHead