Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Bivariate list condition

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

May 3, 2018 12:53 AM
(3429 views)

hi

I'm looking for a condition to start a loop that handles the Bivariate title,

I found one that works only if I have more the 1 chart.

```
lst = dt << Bivariate(
.
.
.
.
);
If(IsList(lst) & (nn = NItems(lst)),
For(i = 1, i <= nn, i++,
.
.
.
.
);
```

I cant find a condition to distinguish between 0 (no chart == dt table is empty) to 1 (only one chart is created).

any help is welcomed

Thanks, Adam

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

The Try() function can be used in many, many ways to keep code from failing, and also to determine is code was properly executed. Here is just one simple way to illustrate it's use

```
Names Default To Here( 1 );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
"not found"
);
If( dis == "not found",
Dialog( "No Table Produced" )
);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
"not found"
);
If( dis == "not found",
Dialog( "No Table Produced" )
);
```

Jim

4 REPLIES 4

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Bivariate list condition

Your description is a bit vague to suggest specific solutions. I suggest you look into

isEmpty(),

N Cols()

and

Try()

as potential functions that can detect the missing charts.

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Bivariate list condition

thanks, Jim

Eventually I used a simple condition Nrows(dt) > 0 to check if the table is empty, not the smartest one but it works.

how can i use the try() function to check if i have 1 or 0 charts in my parameter "lst" ?

Thanks, Adam

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

The Try() function can be used in many, many ways to keep code from failing, and also to determine is code was properly executed. Here is just one simple way to illustrate it's use

```
Names Default To Here( 1 );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
"not found"
);
If( dis == "not found",
Dialog( "No Table Produced" )
);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dis = Try(
dt << Distribution( Continuous Distribution( Column( :height ) ) ),
"not found"
);
If( dis == "not found",
Dialog( "No Table Produced" )
);
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Bivariate list condition

Ok! so that can definitely help.

Thanks!

Thanks, Adam

Article Labels

There are no labels assigned to this post.