Subscribe Bookmark
charles_pirrell1

Joined:

Jun 13, 2014

Always jump to JSL?

Recently, I came across a question posted to the JMP discussion forum. The person who posted the question had the following sample file:

He wanted a count of each unique field in Column 1 shown on every row. So the result would look like this:

The first reply he got to his question suggested that he use a JSL (JMP Scripting Language) script, and the second a SQL query (SQL). The author of the question stated that he was a novice and that he would appreciate it if someone would send him the script --  which a generous, helpful JMP user did.

Both the script solution and SQL solution are fine and effective, but I wondered why no one suggested a solution that did not involve programming -- something  a novice could easily do. Like the following:

Go to the Tables/Summary menu.

Select the column you want to do the count on. And select the desired grouping.

JMP will create the following file:

Then select Table/Join, match up on the desired column and select the desired output columns:

JMP will create the following joined table with your desired results:

Now, for someone who knows JSL and/or wants to automate the process, this is not the best solution. But for someone who is a novice and wants to perform the task manually, this would be the preferable way to go.

So should the person who asked the question be more precise? Or should anyone who answers not jump to a JSL solution? What do you think?

1 Comment
Community Member

MS wrote:

I think manual Summary followed by Update is the sequence I use most often in JMP. Hence the above is the way I would do it if I did it once. If I know I'd do it often I would take the same steps and then save the actions as a JSL script.

However if the table is supposed to incrementally increase or change I would go for a column formula using a built-in statistics formula:

Col Number( :Column 1, :Column 1 )

The col statistics formulas are picky about the format so if Column 1 is in character format (as here) this trick works:

Col Number( Hex To Number( Char To Hex( :Column 1) ), :Column 1 )