cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
jnikkel
Level II

Customize Column Name in Tabulate Funtion JSL

Hello,

I am having difficulty deciphering how to customize the resultant column names from the tabulate script function. My code is here:

obj3 = dt4 << Tabulate(
		Add Table(
			Column Names( :Batch No Intercept ),
			Column Table(
				Grouping Columns( :Batch No Intercept ),
				Analysis Columns( :Aging Rate )
			),
			Row Table( Grouping Columns( :Y Intercept ) )
		 )
	);
	
	obj 3 << Make Into Data Table;

As my column "Batch No Intercept" is a continuous column of sample numbers (###-##-1, ###-##-2, etc) the resultant column names from this script follow: "Sum(Aging Rate, Sample number)"

 

I would like to have the resultant data table only define the column name as exclusively the sample number.

 

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Customize Column Name in Tabulate Funtion JSL

Here is one way to get what you want

names default to here(1);
dt4=current data table();
dt5 = dt4 << Summary(
	Group( :Y Intercept ),
	Sum( :Aging Rate ),
	Subgroup( :Batch No Intercept ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 )
);

dt5 << delete columns( "N Rows");
for(i=1,i<=N Cols(dt5),i++,
	if(word(1,as column(dt5,i)<<get name,"(),") == "Aging Rate",
	column(dt5,i) << set name(word(2,as column(dt5,i)<<get name,"(),")))
);

Using the Summary Platform automatically produces a data table as the output.

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Customize Column Name in Tabulate Funtion JSL

Here is one way to get what you want

names default to here(1);
dt4=current data table();
dt5 = dt4 << Summary(
	Group( :Y Intercept ),
	Sum( :Aging Rate ),
	Subgroup( :Batch No Intercept ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 )
);

dt5 << delete columns( "N Rows");
for(i=1,i<=N Cols(dt5),i++,
	if(word(1,as column(dt5,i)<<get name,"(),") == "Aging Rate",
	column(dt5,i) << set name(word(2,as column(dt5,i)<<get name,"(),")))
);

Using the Summary Platform automatically produces a data table as the output.

Jim
jnikkel
Level II

Re: Customize Column Name in Tabulate Funtion JSL

That worked perfectly! Thank you. One other quick question, when ordering the column, JMP puts 123-45-10 above 123-45-1, instead of at the end of the series example:

 

123-45-10   instead of  123-45-1

123-45-1                       123-45-2

123-45-2                        ...

...                                  123-45-9

123-45-9                       123-45-10

 

Column properties are Character and Nominal. What is the root cause of this?