Subscribe Bookmark RSS Feed

Can I close table windows opened by script using some script command?

Hi All,

I am a JMP script newbie and have one quesiton that i bet is pretty trivial to answer for majority of people in this forum. Here is the script that I am running:

----------------------------------------------------------------------

// Open the raw base data table

raw_data_tbl=open("..\Tables\WA_VS_EXPORT_BASE_VIEW_MKT_1_SAMPLED.jmp");


// Make raw data table the current data table

Current Data Table(raw_data_tbl);

Current Data Table() << Select Where(:Total_interactions >= 1 & :Total_interactions <=40);

raw_data_tbl_sub = Current Data Table() << Subset(columns(
:B_ts,
:B_month,
:B_year,
:C_cd,
:Total_interactions,
:Product,
:T_id,
:Num_interactions,
));

Current Data Table() << Clear Select;

Current Data Table(raw_data_tbl_sub);

// Join the subset table with summary table
chnnl_in_summary = Current Data Table() <<
Join(
With(
Current Data Table() << Summary( Group( :T_id, :C_cd ), N( :Trip_id ) )
),
Select( :B_ts, :B_month, :B_year ),
SelectWith( :T_id, :C_cd ),
Select(
:Total_interactions,
:Product,
:Num_interactions
),
SelectWith( :N Rows ),
By Matching Columns( :T_id = :T_id, :Channel_cd = :Channel_cd ),
Drop multiples( 0, 0 ),
Name( "Include non-matches" )(0, 0)
);

Current Data Table(chnnl_in_summary);

chnnl_in_summary_transp = Current Data Table() << Transpose(
columns( :N Rows ),
By(
:T_id,
:B_ts,
:B_month,
:B_year,
:Total_interactions,
:Product
),
Label( :C_cd )
);

close(raw_data_tbl);
close(raw_data_tbl_sub);
close(chnnl_in_summary);

chnnl_in_summary_transp << save("..\Tables\WA_PATTR.jmp");
close(chnnl_in_summary_transp);

---------------------------------------------------------------------------------------------

The script works fine in terms of processing data the way I want it to, but I get a bunch of (in fact total of three) table windows opened for intermediate tables I create in the process, which is annoying. Plus I get one file dialog asking me whether I want to save one of the tables with the name starting with "Untitled". Her eis the bottom of the script log window:

The data table Subset of WA_VS_EXPORT_BASE_VIEW_MKT_1_SAMPLED has other windows open. You can close all windows for this data table, or just hide it instead.

Save changes to the JMP Data Table Untitled 42?


My question is: how do I properly control these windows from the script such that I don't disrupt the execution of the script (i.e. don't close the entire table when it is needed) yet, make sure everything, including the table windows is closed by the time the script ends? Apparently, the close message sent ot a table is not enough. Really appreciate the answer.

Milorad
3 REPLIES
It looks like posts are limited by its size and I don't know if people on this forum can see the whole post. If not, here is the end of the post:

****
The script works fine in terms of processing data the way I want it to, but I get a bunch of (in fact total of three) table windows opened for intermediate tables I create in the process, which is annoying. Plus I get one file dialog asking me whether I want to save one of the tables with the name starting with "Untitled". Her eis the bottom of the script log window:

The data table Subset of WA_VS_EXPORT_BASE_VIEW_MKT_1_SAMPLED has other windows open. You can close all windows for this data table, or just hide it instead.

Save changes to the JMP Data Table Untitled 42?


My question is: how do I properly control these windows from the script such that I don't disrupt the execution of the script (i.e. don't close the entire table when it is needed) yet, make sure everything, including the table windows is closed by the time the script ends? Apparently, the close message sent ot a table is not enough. Really appreciate the answer.

Milorad

****
Using the close command is correct. To get rid of the dialog you can specify it not to save from within the close function. So for your original table you would use:
--->
close(raw_data_tbl,nosave);
<-----
Within JSL there is an INVISIBLE keyword. It can used in various contexts. The best way to familiarise yourself is to open the JMP Scripting Guide (Help.Books) and do a search for "invisible".

For example, in relation to your code, you can do the following:

Current Data Table() << Select Where( ... );
subsetTable = Current Data Table << Subset( invisible );