cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
nbullen
Level II

Summarize Without Alphabetizing

I have a dataset where the order is important and I want to be able to summarize a character column with repeat values without the results being in alphabetical order.

 

column_A

 

f

f

b

b

b

d

a

a

c

c

c

e

e

 

Usual methods return {a,b,c,d,e,f},

I am trying to get {f,b,d,a,c,e}

 

Please advise.

2 ACCEPTED SOLUTIONS

Accepted Solutions
nbullen
Level II

Re: Summarize Without Alphabetizing

Sometimes, just by asking you end up freeing your mind to possible solutions. I give to you, the non-alphabetizing summarizer:



no_sort_summarize = function({list},
	design_matrix = Design( list, list ); //compares the list to itself returning a 1 in the position of the first match for each repetition
	summarized_matrix = (Transpose(V Sum(design_matrix))); //flatten matrix into one row and transpose into columns
	unique_value_positions = Loc(summarized_matrix); //return only the position of the first instance of a value thus creating a summary
	return(list[unique_value_positions]); //subscript list to return the non-sorted summarized values 
);

 

View solution in original post

Re: Summarize Without Alphabetizing

I can officially confirm that Summarize() does now support the Value Ordering property as of JMP 14 and later.

View solution in original post

8 REPLIES 8
nbullen
Level II

Re: Summarize Without Alphabetizing

Sometimes, just by asking you end up freeing your mind to possible solutions. I give to you, the non-alphabetizing summarizer:



no_sort_summarize = function({list},
	design_matrix = Design( list, list ); //compares the list to itself returning a 1 in the position of the first match for each repetition
	summarized_matrix = (Transpose(V Sum(design_matrix))); //flatten matrix into one row and transpose into columns
	unique_value_positions = Loc(summarized_matrix); //return only the position of the first instance of a value thus creating a summary
	return(list[unique_value_positions]); //subscript list to return the non-sorted summarized values 
);

 

txnelson
Super User

Re: Summarize Without Alphabetizing

If the order you want to summarize by is the order found in the data, you can set the column property, "Row Order Level" for Column_A, and then run

     Tables==>Summary

and the data will be summarized in the order the grouping column was found in the data table

roworder.PNG

 

Jim
dale_lehman
Level VII

Re: Summarize Without Alphabetizing

And, more generally, you can use the Value Ordering column property to impose whatever order on the variable you wish.  That order will be used in any subsequent analysis (tablulation, graphs, etc.).

Jeff_Perkinson
Community Manager Community Manager

Re: Summarize Without Alphabetizing

Unfortunately, in JMP 13 and earlier the Summarize() JSL function doesn't respect the Value Ordering property.

 

I've confirmed that this will be corrected in JMP 14.

-Jeff
dale_lehman
Level VII

Re: Summarize Without Alphabetizing

Another reason I'm glad I rarely script anything - Tabulate works just fine with Value Ordering.

Re: Summarize Without Alphabetizing

I can officially confirm that Summarize() does now support the Value Ordering property as of JMP 14 and later.

PhiIippe
Level II

Re: Summarize Without Alphabetizing

Hi Jeff,

 

I have JMP 14, but my summarize() function is still alphabetic, does the non-alphabetic version have another name?

 

Philippe 

txnelson
Super User

Re: Summarize Without Alphabetizing

I have tried setting the Value Ordering column property for both numeric and character columns under JMP 14.3 and the Summarize() function uses the Value Ordering property as it's order.

Jim