Hi, what is the JMP Script equivalent of Base SAS scan function, that splits a string according to a delimiter?
(Simple enough question, but . . . )
Regards
Poul
The function returns a List, which is not a data type that is supported in table cells (only numeric, character, and row state is allowed). So Words() by itself is not well adapted to column formulas.
To see the whole list as a string in the table (set column data type to "character" first):
Char( Words( :Column 1, "_," ) )
To get the first word (picks first item of list):
Words( :Column 1, "_," )[1]
or better (picks first "word" without wasting time in making a list of all "words" first):
Word( 1, :Column 1, "_," )
The Words() function can do that. It can handle one or more delimiters. Returns a list of all the "words".
Words( "one_two,three", "_," )
/*:
{"one", "two", "three"}
Hm, then why does this not work? See attached screen dump showing formula and results in the background