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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Try/Eval method for columns that are empty

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

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

Sep 15, 2016 7:38 AM
(3811 views)

Hi,

I've tried to use examples here from disucssions regarding empty columns but with no success. Does anyone know how I can achive the following?

Depending on the imported data I will either have 1 or 6 columns with data (they will allways be imported but some will be imported without containing any data).

try (

if column contains data put it into a list

else

try next column

)

**the 6 columns of data has a number of columns inbetween them that is not off interest. so for example:**

column 1 (try/eval) column 2 (not interested in) ..... Column 6 (try/eval) etc.

I've tried the missing data pattern function and tried to modify if**(**NRow**(**Loc**(**IsMissing**(**m**[****0**,c**])))** == NRow**(**m**) ** without success.

BR

Anders

1 ACCEPTED SOLUTION

Accepted Solutions

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

Here is a simple script that will return a list with the names of all of the columns that contain data

**Names Default To Here( 1 );**

**dt = Current Data Table();**

**HaveDataList = {};**

**For( i = 1, i <= N Cols( dt ), i++,**

** If( Col Number( Column( dt, i ) ) > 0,**

** Insert Into( HaveDataList, Column( dt, i ) << get name )**

** )**

**);**

Jim

2 REPLIES 2

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

Here is a simple script that will return a list with the names of all of the columns that contain data

**Names Default To Here( 1 );**

**dt = Current Data Table();**

**HaveDataList = {};**

**For( i = 1, i <= N Cols( dt ), i++,**

** If( Col Number( Column( dt, i ) ) > 0,**

** Insert Into( HaveDataList, Column( dt, i ) << get name )**

** )**

**);**

Jim

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

Re: Try/Eval method for columns that are empty

**This function was what I was looking for, thank you. **

**If( Col Number( Column( dt, i ) ) > 0,**

** Insert Into( HaveDataList, Column( dt, i ) << get name )**

** )**