Page 1 of 1

@uniquevals excludes spaces?

Posted: Thu Oct 13, 2016 7:53 am
by chester
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! :)
eviewsrequest.PNG
eviewsrequest.PNG (25.88 KiB) Viewed 4192 times

Re: @uniquevals excludes spaces?

Posted: Thu Oct 13, 2016 8:09 am
by EViews Gareth
You'll have to provide more information.

Re: @uniquevals excludes spaces?

Posted: Thu Oct 13, 2016 12:26 pm
by chester
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.

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

Re: @uniquevals excludes spaces?

Posted: Thu Oct 13, 2016 12:45 pm
by EViews Gareth
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:

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?

Posted: Thu Oct 13, 2016 12:57 pm
by chester
That worked wonderfully. I was not aware of that built-in function.
Thanks!