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
 Origin Forum
 Sort data+error(s) columns by label
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1205 Posts

Posted - 12/09/2020 :  05:48:35 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2021 (64-bit) 9.8.0.200
Windows 7 Pro x64 SP1

Greetings!

I want to sort data-error pair of columns by Mean label:


How do I achieve this properly using Origin's toolbox?

Thank you.

---
Andrey

snowli

USA
1424 Posts

Posted - 12/09/2020 :  09:33:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We have Worksheet: Sort Columns by Label but it checks each column individually.

Jira created: ORG-22970. I will check with developer if we should consider corresponding error bar, X, etc.

Thanks, Snow
Go to Top of Page

YimingChen

1658 Posts

Posted - 12/09/2020 :  10:11:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
One workaround is to first set the error column Longname the same as corresponding y column and then sort by Longname. You have YYerrYYerr... kind of data, you can select all y and yerror columns, right click and select Set Multiple Column Values..., Put the LT script in Before Formula Scripts box and Apply.

if (mod(j,2) == 0){
    wcol(j)[L]$ = wcol(j-1)[L]$;
}


James

Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 12/09/2020 :  11:10:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

One workaround is to first set the error column Longname the same as corresponding y column and then sort by Longname. You have YYerrYYerr... kind of data, you can select all y and yerror columns, right click and select Set Multiple Column Values..., Put the LT script in Before Formula Scripts box and Apply.

if (mod(j,2) == 0){
    wcol(j)[L]$ = wcol(j-1)[L]$;
}


James



Thank you for the suggestion.
It is like this now (see the screenshot above).
Now how do I sort YYerrYYerr... columns my Y Mean, say descending while keeping YYerr together?

---
Andrey
Go to Top of Page

YimingChen

1658 Posts

Posted - 12/09/2020 :  12:14:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I don't see attached picture. You should have yerr columns fill with numbers now, see below:


Then use menu Worksheet-> Sort Columns By Labels.. to sort by Long Name descending.

James
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 12/09/2020 :  10:34:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

I don't see attached picture. You should have yerr columns fill with numbers now, see below:

Then use menu Worksheet-> Sort Columns By Labels.. to sort by Long Name descending.

James



This will not produce the desired result.
Please compare Original and Sorted sheets in the attached project: https://my.originlab.com/ftp/forum_and_kbase/Images/Column%20Sorting%20Test.opju

---
Andrey
Go to Top of Page

YimingChen

1658 Posts

Posted - 12/10/2020 :  09:21:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please modify the script accordingly. Use the script below in your case. Then sort worksheet by column header row Mean.

if (mod(j,2) == 1){
    wcol(j)[D1]$ = wcol(j-1)[D1]$;
}




James

Edited by - YimingChen on 12/10/2020 09:22:57 AM
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 12/10/2020 :  12:57:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Please modify the script accordingly. Use the script below in your case. Then sort worksheet by column header row Mean.

if (mod(j,2) == 1){
    wcol(j)[D1]$ = wcol(j-1)[D1]$;
}

James



This works --- thank you.
However, by default, It would be great if Error columns will stick to their host data columns (both X and Y) while being sorted.

---
Andrey
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