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
 All Forums
 Origin Forum
 Origin Forum
 Unstack based on number of columns

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
saconrad Posted - 01/15/2014 : 11:39:24 PM
Origin Ver. and Service Release (Select Help-->About Origin): 9.1.0 SR1
Operating System: Win 8

Is there a way to unstack a column based on the number of rows rather than a grouping variable?

e.g.
1
5
3
6
3
4

would be unstacked in groups of 2 rows to become:

1 5
3 6
3 4


Steven Conrad, MD PhD
5   L A T E S T    R E P L I E S    (Newest First)
piotrczrnota Posted - 03/07/2015 : 05:43:50 AM
Thanks for the solution, really helped me.
snowli Posted - 03/06/2015 : 11:07:01 AM
We added an xfunction colsplit in Origin 2015 sr1 to support unstack columns by number of rows or by number of columns

Select column(s) you want to split and run colsplit -d in Script window to open the dialog.

greg Posted - 01/16/2014 : 4:52:12 PM
There is also a very old LabTalk command to "unzip" a column into two:
copy -u col(source) col(destOdd) col(destEven)
as in
copy -u col(A) col(ODD) col(EVEN)

Change the "A" to match your source column, then copy and paste the line to the Command Window and press Enter.
snowli Posted - 01/16/2014 : 12:50:25 PM
Besides what Kathy suggested, if you have a 1 column worksheet, you can choose Worksheet: Convert to Matrix: Expand.
Set "Expand for Every Row/Col" to be 2
Click OK

It will reorganize the data but right now we only support matrix window as output.

So you have to select Matrix: Convert to Worksheet with direct method to change it back to a worksheet.

I will check if we can improve this Expand to support output to be a worksheet as well. I created jira https://originlab.jira.com/browse/ORG-10475

for this.

Thanks, Snow
OriginLab Corp.
Kathy_Wang Posted - 01/16/2014 : 03:38:01 AM
Hi,

I think you could add another column and use it as the grouping range. In the new column, use the Set Column Values to set its formula as mod(i,2), which means the remainder that row index divided by 2, and then you will have a worksheet like below, and you could further use column B as grouping range to unstack column A and get your desired result.



Kathy
Originlab

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000