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
SamruddhiB
Level II

Column Information

How to get column information for all columns in a table together at one place. Need to get column information for 8 tables with 250+ columns each.

2 ACCEPTED SOLUTIONS

Accepted Solutions
SamruddhiB
Level II

Re: Column Information

Thank you for this solution!

Is there a way in the columns viewer to get the column attributes like 'Data Type' and 'Modeling Type'? 

View solution in original post

Re: Column Information

I published a JMP add-in earlier today that does what you are looking for. Check it out here.

Justin

View solution in original post

9 REPLIES 9
ian_jmp
Staff

Re: Column Information

I suppose it depends on what you consider informative, and how, exactly, you want this information displayed.

 

But if you want everything about a columns in a table, apart from the data they contain, you ciuld make a copy of the table, delete all the rows, then do 'Copy Table Script' from the triangle menu of the table. Then paste the results into a new script window to inspect the result. For eight tables, you could do this with JSL, and also post-process, reformat and display the results how you want.

Jeff_Perkinson
Community Manager Community Manager

Re: Column Information

We could use some more details about what column information your looking for and how you'll use it but perhaps another option is Cols -> Columns Viewer.

 

JMPScreenSnapz094.png

-Jeff
SamruddhiB
Level II

Re: Column Information

Thank you for this solution!

Is there a way in the columns viewer to get the column attributes like 'Data Type' and 'Modeling Type'? 

ian_jmp
Staff

Re: Column Information

If you want this information you could get it this way:

NamesDefaultToHere(1);

// Define a function: Given a table reference, makes a window with the required information
dataAndModelingType = 
Function({dat}, {Default Local},
	cols = dt << getColumnNames("String");
	na = {};
	dt = {};
	mt = {};
	for(c=1, c<=NItems(cols), c++,
		InsertInto(na, Column(dat, cols[c]) << getName);
		InsertInto(dt, Column(dat, cols[c]) << getDataType);
		InsertInto(mt, Column(dat, cols[c]) << getModelingType);
	);
	NewWindow("Data and Modeling Types in "||(dat << getName),
		PanelBox("Column Info",
			TableBox(
				StringColBox("Column Name", na),
				StringColBox("Data Type", dt),
				StringColBox("Modeling Type", mt)
				);
			);
		);
	);

// Try it out
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
dataAndModelingType(dt);

This could probably be appended to the 'Column Info' dialog but would be more work.

 

So, as I said, the answer does depend on what information you want, how you want it displayed and (possibly) what you want to use it for next.

powerpuff
Level IV

Re: Column Information

Hi @ian_jmp I am trying to tweek your script to also extract "Coding" from Column Information and it doesn't seem to work. Is it possible to also extract the "Coding" section? Thanks

Jeff_Perkinson
Community Manager Community Manager

Re: Column Information

The Get Property message to the data table column will get you the Coding property.

 

Look at the complete list of messages for data table column in the Help->Scripting Index.

JMPScreenSnapz185.png

-Jeff

Re: Column Information

I published a JMP add-in earlier today that does what you are looking for. Check it out here.

Justin
SamruddhiB
Level II

Re: Column Information

Tons of thank you for this solution!

Just wondering if we change the attribute table and save it, then can we apply the changes directly to the data table in JMP itself?

Re: Column Information

I do have plans to add a feature like that at some point in the future. I will let you know when it is updated.

Justin