Check if data is text

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

luan_ngo
Posts: 5
Joined: Sun Dec 27, 2015 5:30 pm

Check if data is text

Postby luan_ngo » Mon Feb 01, 2016 4:03 pm

I'm importing a table from Excel and the value of some cells can be either text or numbers. In my program, if it's text, it will be treated differently than numbers. Is there a way I can see whether the value in my alpha series is a number or text?

Thanks!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Check if data is text

Postby EViews Gareth » Mon Feb 01, 2016 4:07 pm

Use the @val function to convert the text to a number. If it returns NA, you know it isn't a number.

luan_ngo
Posts: 5
Joined: Sun Dec 27, 2015 5:30 pm

Re: Check if data is text

Postby luan_ngo » Mon Feb 01, 2016 4:36 pm

Thanks!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests