The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 wsort and "Criteria Columns has repeated elements"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cdrozdowski111

USA
247 Posts

Posted - 03/22/2013 :  05:29:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 9.0.0 SR1, Win7 64-bit, running in VMware Fusion 5.0.2

I am trying to sort some text columns (code snippet below) using the wsort X-function and get the following message (and the sorting fails):

"Criteria Columns has repeated elements"

I can use the -sb switch to suppress the message but they sorting still fails. Is there anyway to overcome this? If not, is there another mechanism I could use to for this sort?


dataset dsSortCols = {2, 4};
dataset dsSortOrd = {2, 4};
wsort nestcols:=dsSortCols order:=dsSortOrd;

Penn

China
644 Posts

Posted - 03/24/2013 :  9:51:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The order parameter is not right in your script. In your script, you want to sort the active worksheet firstly according to the 2nd column, then according to the 4th column, right?. However, how to sort the worksheet (ascending or descending) is not correct, which is specified by order in your script. The elements of the dataset dsSortOrd can only be 0 (for descending) or 1 (for ascending). For more details, you can refer to the example in XF Script Dialog, which is opened by pressing F11, then see wsort under Data Manipulation\Worksheet.

Penn
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000