How to Identify Unique Values in a Column from a Data Table (to a Scripting Newbie)Assuming I am familiar with programming languages in general, but not the syntax of JMP/JSL specifically, please understand that when I looked up
https://community.jmp.com/t5/Discussions/JSL-get-unique-values-of-a-data-table-column/td-p/985
https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/scripting-data-tables.shtml
and
https://community.jmp.com/t5/JSL-Cookbook/Get-a-list-of-the-unique-values-in-a-column-matrix-or-list/ta-p/51256
none of the solutions worked for me when I try to find a summary of the unique values in a column scriptorially (not via Recode). The reason for doing it scriptorially is I would like to feed the output to other input funnels in another portion of the script.
Here is my code (anonymized and hopefully without typos):
dt = Open( "data file" );
//show(summarize(dt=by("column of interest")));
//dt << Summary(Group(:column of interest), Freq("None"), Weight("None"));The lines which are commented out do not seem to work for me. I don't even know if I am importing the data correctly, to be honest. "data file" is a .jmp file. How would I know? Would it open up? It doesn't seem to be doing that.
Pardon if this is a double post but I really appreciate the understanding.
Thank you,
Michael
AnalyticsData TableScriptingRe: How to Identify Unique Values in a Column from a Data Table (to a Scripting Newbie)Here is at least two ways to get unique values; Summarize and Associative Array with get keys:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Summarize(dt, uniqNames = by(:name));
Show(uniqNames);
aa_uniqNames = Associative Array(Column(dt, "name")) << Get keys;
show(aa_uniqNames);Also take a look at the following sources for scripting:
1. Directly from JMP take a look under Help/Scripting Index (search for Summarize for example)
2. Scripting Guide
3. JMP Help, Scripting Guide
Re: How to Identify Unique Values in a Column from a Data Table (to a Scripting Newbie)Where will uniqNames be shown?Re: How to Identify Unique Values in a Column from a Data Table (to a Scripting Newbie)From Scripting Index:

With Summarize the results are saved in variables with the names specified.
You can see them in Log window: View/Log (Ctrl+Shift+L shortcut) or right click on script editor and enable Show Embedded Log (I suggest enabling this from preferences to be shown always).
Embedded log:
