Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level III

## How to use data table scoping?

Hi,

I have multiple data tables in my application. One is the main table opened in the beginning, others have been created

using subset. I have the things working but I would like some clarification.

I am having trouble using the scoping. I would like to know if I absolutely have to use Current Data Table(dt) before plotting something

or I can just use dt:ColumnName and so on inside my plots.

For example:

``````Distribution(
Continuous Distribution(
Column(dt:ColumnName)
)
);``````

Is the use of dt okay in this case? Can I use dt in the "By" group as well? Or do I always need to make dt my current table and then use column

names without table reference.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: How to use data table scoping?

The proper way to scope what data to use for a platform is to pass to the data table a platform message.  This insures that the platform is using the correct data table

``````names default to here(1);
dt = Open("\$SAMPLE_DATA/big class.jmp");
dt << select where(:Sex == "F");

dt2 = dt << subset( selected rows(1), selected columns(0));

// run a Bivariate against the original data table
dt << Bivariate(x(;weight), y(:height));

// run a Bivariate against the subsetted data table
dt2 << Bivariate(x(;weight), y(:height));``````
Jim
Highlighted
Super User

## Re: How to use data table scoping?

The proper way to scope what data to use for a platform is to pass to the data table a platform message.  This insures that the platform is using the correct data table

``````names default to here(1);
dt = Open("\$SAMPLE_DATA/big class.jmp");
dt << select where(:Sex == "F");

dt2 = dt << subset( selected rows(1), selected columns(0));

// run a Bivariate against the original data table
dt << Bivariate(x(;weight), y(:height));

// run a Bivariate against the subsetted data table
dt2 << Bivariate(x(;weight), y(:height));``````
Jim
Article Labels

There are no labels assigned to this post.