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
 Generating accumulated data

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
yt47106 Posted - 04/12/2010 : 07:15:16 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR5
Operating System:XP

Hi,

what is the easiest way to generate a new dataset, col(New) containing a continous accumulation of another dataset, col(A).
Each row in col(New) should be the sum of corresponding row in col(A),[ii], added the previously row in col(New), [ii]-1,

Regards, Bjorn
2   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 04/14/2010 : 5:07:23 PM
Hi Bjorn,

You can simply use the sum() function:

1> add the result/New column
2> bring up set values dialog on the result/new column and enter
sum(col(a))
in the edit box and press OK

The sum() function and other functions are available from the F(x) menu in the Set Values dialog, sum is under Statistics category.

Note that you can then also set recalculate to auto so if source data changes the result will automatically update.

Easwar
OriginLab
Penn Posted - 04/13/2010 : 02:42:37 AM
Hi Bjorn,

You can use the Setting Column Values dialog and LabTalk script to do that. Copy and paste the following script to the Before Formula Scripts box of the Set Values dialog.

for(ii=1; ii<=wks.nrows; ii++)
{
    if(ii==1)
        col(New)[1] = col(A)[1];
    else
        col(New)[$(ii)] = col(A)[$(ii)] + col(New)[$(ii-1)];
}


Penn
OriginLab Technical Services

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