Hi I'm using the @uniquevals command in order to read repetitive values in an Excel column into an EViews list, which shows up in a drop-down list from a pop up window (in EViews).
The problem is that if the cell contains two words separated by a space, it interprets the two words as if they are unique values. For example, "Price Indexes" gets interpreted as "Price" in one list option, an "Indexes" as the following option.
Is there any way to work around this? I've attached a screenshot illustrating my issue. Thanks in advance! :)
@uniquevals excludes spaces?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @uniquevals excludes spaces?
You'll have to provide more information.
Re: @uniquevals excludes spaces?
So 'group' is a column in my Excel file. It contains only strings. Sometimes two words.
For example, in one cell, it may contain the value "One word" but in the EViews pop-up list, "One" shows up in a separate line as "word".
This is the problematic section of my code.
For example, in one cell, it may contain the value "One word" but in the EViews pop-up list, "One" shows up in a separate line as "word".
This is the problematic section of my code.
Code: Select all
svector uniquegroups =@uniquevals(group)
for !j=1 to @rows(uniquegroups)
list = list + " " +uniquegroups(!j)
next
scalar result=0
@uidialog( "List", result, "Choose the data to be updated", list)
if(result==0) then
stop
endif-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @uniquevals excludes spaces?
The issue has nothing to do with @uniquevals. Indeed, I'm willing to bet that if you open up the svector containing the values, you'll see it worked just fine.
The issue is with the way you're building up your string.
Rather than do it manually, you're probably better off using the built in function:
The issue is with the way you're building up your string.
Rather than do it manually, you're probably better off using the built in function:
Code: Select all
svector uniquegroups =@uniquevals(excelstuf)
list = @wjoin(uniquegroups)
scalar result=0
@uidialog( "List", result, "Choose the data to be updated", list)
if(result==0) then
stop
endif
Re: @uniquevals excludes spaces?
That worked wonderfully. I was not aware of that built-in function.
Thanks!
Thanks!
Who is online
Users browsing this forum: No registered users and 1 guest
