cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
AT
AT
Level V

How to save standardized columns in a script?

I like to save the standardized columns using JSL. Here are is what I had in mine and I get an error when I run the script.

 

 

dt = Current Data Table();
cc = dt << Get Column Names( Continuous ); '
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
cc << Set Selected( 0 ),
col = Column(dt,cc), Distribution( Continuous Distribution(col,Save(Standardized))) );

 

I appreciate your help. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to save standardized columns in a script?

Not only does the code make the display invisible but it also closes the display, thus freeing up memory

Names Default to Here( 1 );
dt = Current Data Table();
cc = dt << Get Column Names( Continuous );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
	dis = Distribution( Invisible, Continuous Distribution( Column(  cc[i] ) ) );
	dis << Save( Standardized );
	dis << close window;
);

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How to save standardized columns in a script?

Here is a modification of your code that works as you want.  You need to become familiar with the Scripting Index, for it will give you the syntax and examples of how to accomplish what you want

Names Default to Here( 1 );
dt = Current Data Table();
cc = dt << Get Column Names( Continuous );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
	dis = Distribution( Continuous Distribution( Column(  cc[i] ) ) );
	dis << Save( Standardized );
);
Jim
AT
AT
Level V

Re: How to save standardized columns in a script?

Thanks Jim. How do you make the distribtions invisibile. I have quite many variables and don't want to see the histograms. 

txnelson
Super User

Re: How to save standardized columns in a script?

Not only does the code make the display invisible but it also closes the display, thus freeing up memory

Names Default to Here( 1 );
dt = Current Data Table();
cc = dt << Get Column Names( Continuous );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
	dis = Distribution( Invisible, Continuous Distribution( Column(  cc[i] ) ) );
	dis << Save( Standardized );
	dis << close window;
);

Jim
AT
AT
Level V

Re: How to save standardized columns in a script?

Thanks so much Jim.