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
 Conditional data summation

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
falagar Posted - 02/28/2011 : 08:16:16 AM
Hi,

I have a set of data that includes columns with data and columns with "markers". The data is the summation of measurement values and the marker value A shows at which point in the column the summation starts again from 0. Then there is in the marker column a marker value B which shows that a set of summations is finished.

I need to take all the summation values (marked with A) of one set (end marker B) and sum them up. As there a a lot sets of summations I do not want to do it "by hand". Is there a script based solution?

(I know that if the summations occured in defined rows I could simply say: sum up column G from 1 to 5 and 6 to 10, but it isnt that easy.)

(G)(H)
1 x
3 x
4 A
1 x
2 A
1 x
2 x
4 B
1 x
3 x
.......
Need: sum (if H includes A or B take value from G, but only until B, then start again from 0)


Thanks !
2   L A T E S T    R E P L I E S    (Newest First)
falagar Posted - 03/02/2011 : 03:46:53 AM
Thanks alot !
greg Posted - 02/28/2011 : 10:19:09 AM
range rad = 1;
range ras = 2;
total = 0;
loop(ii,1,rad.GetSize())
{
if(ras[ii]$=="A") total += rad[ii];
if(ras[ii]$=="B")
{
total += rad[ii];
col(3)[ii] = total;
total = 0;
}
}

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