cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
miguello
Level VII

How to refer to a column in Group By() message in Bivariate Platform

I have a Bivariate Platform scripted like this:

Fit Group(
	biv = Bivariate( Y(Eval(Y_parameters)), X(Eval(X_parameters)), Group By (groupByColumn[1]),
			SendToReport(...)
	)
)

where 

Y_Parameters = {"Param1", "Param2"};
X_Parameters = {"Radius"};
groupByColumn = {"Lot ID"};

So, it works ONLY if my groupByColumn is a list of strings, and only if I refer to it as groupByColumn[1]

if I say 

stringGroupByColumn = groupByColumn[1]

and then use 

Group By (stringGroupByColumn)

it won't work.

WHY?

If I say 

groupByColumn = "Lot ID";

and then use it - it also won't work. WHY?

 

3 REPLIES 3
txnelson
Super User

Re: How to refer to a column in Group By() message in Bivariate Platform

The reason it does not work is because you are not setting a variable value, but rather you are passing a message to thr Bivariate Platform.  The proper syntax is

Biv << Group By( :lot ID );

See the Scripting Index for examples

Jim
miguello
Level VII

Re: How to refer to a column in Group By() message in Bivariate Platform

Ok, what if I don't know the column name and I just picked it from Col List Box?

When I get columns from Col List Box using << Get Items it returns them as:

Y_Parameters = {"Param1", "Param2"};

in case of the Col List Box that I use to cast Group By it only returns one due to the settings of Col List Box, it returns it as this:

groupByColumn = {"SomeRandomColumn"};

the only way to use it is 

Group By (groupByColumn[1])
miguello
Level VII

Re: How to refer to a column in Group By() message in Bivariate Platform

Ok, looks like it works this way:

 Y_parameters = colListYParameter << Get Items;
X_parameters = colListXParameter << Get Items;
groupByColumnNames = colListBox << Get Items;
groupByColumn = Column(groupByColumnNames [1]);

biv = Bivariate( Y(Eval(Y_parameters)), X(Eval(X_parameters)),Group By (groupByColumn), Fit Spline( 0.1, Standardized), 
			SendToReport(...)
)

Basically, I wanted to use "clean" variable, that is just a reference to column, without it being a subscript of a string array.

 

Recommended Articles