cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Nuroffen
Level II

How to switch between Device table

Hello, 

 

I didn't found any function for this but it must exist. 

I have one table full of data "Data" where I make some calculation, then I create a new data table "Newdata".

My point is that after I created my new data table "Newdata", i don't manage to select my first table of data "Data" to make new calculations.

 

That's why Im looking for something to say "don't use the data table you have just created but select the first one and use it".

 

I hope it's clear enough. 

 

Thank you !

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Level X

Re: How to switch between Device table

If you are doing this in JSL, try assigning a reference to the tables you want to manipulate, then use the appropriate reference for subsequent operations. For example:

NamesDefaultToHere(1);

dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Bands Data.jmp");
Print(CurrentDataTable() << getName);
Print(dt1 << getName);
Print(dt2 << getName);

 

View solution in original post

4 REPLIES 4
ian_jmp
Level X

Re: How to switch between Device table

If you are doing this in JSL, try assigning a reference to the tables you want to manipulate, then use the appropriate reference for subsequent operations. For example:

NamesDefaultToHere(1);

dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Bands Data.jmp");
Print(CurrentDataTable() << getName);
Print(dt1 << getName);
Print(dt2 << getName);

 

Re: How to switch between Device table

Strongly agree with Ian's suggestion to assign references to tables in JSL, using the table reference wherever it is needed:

table1 << Bivariate(...)

New tables are generally made "current", and actions such as activating a window can change the current table.  It is possible to use Current Data Table() to switch between them, but your script will be much more robust using the dt references.

Also shown in Ian's example is the use of Names Default To Here(1), which can help to insulate your script from another script using the same reference symbols.

Nuroffen
Level II

Re: How to switch between Device table

Thanks to  ian_jmp, danschikore and mark_anawis for your awnser.

Opening the table is smart and work perfectly !

mark_anawis
Level IV

Re: How to switch between Device table

If you are not comfortable scripting, you could potentially use a Virtual Join between the 2 tables to access data from "Data" into "Newdata". Here's a link to a brief JMP video on the topic: Virtual Joins - JMP User Community

If you are using the Formula Editor in "Newdata" for calculations, you could reference data from the "Data" table by using a column reference such as:

as column (data table("Data"), "my_column_data")

where "my_column_data" is the name of the column in "Data" table which contains the data you want to use in "Newdata".

I agree with Ian and Dan that scripting is the most flexible and powerful way to go. I myself prefer scripting but fortunately there are often several ways to get the job done in JMP even if you're not a scripter.