BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
csoon1
Community Trekker

What is the best way to assess if a column has an entry or not

Hi. I have the code below where I go through all columns on my table and add them to a list. It works fine. However, I just realized now that there is no point adding columns on my list that do not even include an entry (or is empty). Now I want to update my code below to include an "if" statement perhaps that if a column does not contain any data or entry, then I'll simply ignore it. What's the best way or method to implement this? Thanks.

 

 

// Populate X Group list
Insert Into( xGroupList, "Site" );
For( j = i, j <= N Cols( Data Table( a ) ), j++,
	Insert Into( xGroupList, Column( Data Table( a ), j ) << Get Name )
);

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: What is the best way to assess if a column has an entry or not

If(col number(:age),==0, ...... );

 

this works for both numeric and character columns

Jim
2 REPLIES 2
txnelson
Super User

Re: What is the best way to assess if a column has an entry or not

If(col number(:age),==0, ...... );

 

this works for both numeric and character columns

Jim
csoon1
Community Trekker

Re: What is the best way to assess if a column has an entry or not

Thanks! It worked.