This should be fairly simple. I'm trying to convert a numeric field into a string.
series FieldName = @str(CustomerNumber)
I get an error message: Can not assign string expression to numeric variable in...
The CustomerNumber is a number between 10 and 15 digits. It is also used to give structure to the series in panel data.
What could be the problem?
Converting a Number into String
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Converting a Number into String
alpha FieldName rather than series FieldName
-
franciscoA
- Posts: 10
- Joined: Fri Oct 25, 2013 6:49 am
Re: Converting a Number into String
Thank you. That worked. But I can still solve my problem. The string is being written as scientific notation. What I'm actually trying to do is to get the last four digits:
alpha FieldName = @str(CustomerNumber)
series NewCustomer = @right(FieldName, 4)
returns = e+13
alpha FieldName = @str(CustomerNumber)
series NewCustomer = @right(FieldName, 4)
returns = e+13
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Converting a Number into String
Take a look at the Help system documentation for @str. You can supply a format specification that might give you what you want.
Who is online
Users browsing this forum: No registered users and 2 guests
