cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
MuttonChops
Level III

Tabulate a variable column list

I am using the following to generate a column list, which varies but always has an "X_Clean" in the name:

col_list = dt<<get column names(string);
	for(i=nitems(col_list), i>0, i--,
		if(!contains(col_list[i], "X_Clean"),
				remove from(col_list, i);
		)
);

Now I'm trying to create a tabulate box but I'm unsure how to reference this col_list in the Analysis Columns.  

dtLUB= vlistbox(dt<< Tabulate(
	Change Item Label( Statistics( Max, " " ) ),
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Analysis Columns( :Date ), Statistics( Max ) ),
		Column Table(
			Analysis Columns(
Need to insert col_list here somehow
			),
			Statistics( Max )
		),
		Row Table( Grouping Columns( :Entity) )
	),
	SendToReport(
		Dispatch(
			{},
			"Tabulate",
			OutlineBox,
			{Set Title( "PM Counter Summary as of: "|| TimeStamp )}
		)
	),
));
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Tabulate a variable column list

This should work

dtLUB= vlistbox(dt<< Tabulate(
	Change Item Label( Statistics( Max, " " ) ),
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Analysis Columns( :Date ), Statistics( Max ) ),
		Column Table(
			Analysis Columns(
				eval( col_list )
			),
			Statistics( Max )
		),
		Row Table( Grouping Columns( :Entity) )
	),
	SendToReport(
		Dispatch(
			{},
			"Tabulate",
			OutlineBox,
			{Set Title( "PM Counter Summary as of: "|| TimeStamp )}
		)
	),
));
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Tabulate a variable column list

This should work

dtLUB= vlistbox(dt<< Tabulate(
	Change Item Label( Statistics( Max, " " ) ),
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Analysis Columns( :Date ), Statistics( Max ) ),
		Column Table(
			Analysis Columns(
				eval( col_list )
			),
			Statistics( Max )
		),
		Row Table( Grouping Columns( :Entity) )
	),
	SendToReport(
		Dispatch(
			{},
			"Tabulate",
			OutlineBox,
			{Set Title( "PM Counter Summary as of: "|| TimeStamp )}
		)
	),
));
Jim
MuttonChops
Level III

Re: Tabulate a variable column list

Thanks Jim!