cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
aliegner1
Level IV

Script: How to send a group of columns to selection on FitYbyX?

 

Wondering if this is possible. I have a bunch of columns I've grouped together and want to standardize a script that will send all the columns in a group to the Yresponse. Each instance of this data table will have a variable amount of columns and the names will be changing and not fixed.

 

I'd love to just say: Send this group to the Yresponse.

 

aliegner1_0-1624652076193.png

 

3 REPLIES 3
Craige_Hales
Super User

Re: Script: How to send a group of columns to selection on FitYbyX?

dt = Open( "$SAMPLE_DATA/Cities.jmp" );
dt << group columns( "xy", {:X, :y} );
dt<<Bivariate( Y( :OZONE ), X( dt<<get column group( "xy" ) ) );
Craige
aliegner1
Level IV

Re: Script: How to send a group of columns to selection on FitYbyX?

wondering how I could script it to send all the column groups to the plot?

 

How to do this dynamically? Is there a way to generate a list of the column groups, and then send that list to the X()?

Craige_Hales
Super User

Re: Script: How to send a group of columns to selection on FitYbyX?

The scripting index shows a function you could use to get the column group names. You could use each of those names to call the get column group method and build a full list to pass to the platform you are running.  Roughly:

// untested
groupnames = dt<<getcolumngroupnames;
biglist={};
for(igroup=1,igroup<=nitems(groupnames),igroup+=1,
   insertinto(biglist, dt<<getcolumngroup( groupnames[igroup] ));
);
show(biglist);
... X(biglist) ...

scripting indexscripting index

Craige