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 for Programming
 LabTalk Forum
 How to GROUP&SUM column data (group by)

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
porter Posted - 12/01/2010 : 02:06:13 AM
Hello,

I do not know how to group data and calculate the sum of of a specific column within this group.

Example: (data are in Book1/sheet1)

Col_A_______Col_B
1____________3
1____________2
1____________1
2____________1
2____________2
3____________3
3____________2
3____________1
3____________1

Result should be:

Col_C______Col_D
1____________6
2____________3
3____________7

Can I somehow integrate a SQL statement into my Lab Talk script to do the job? ....any other suggestions?

Thanks for your help.
porter


2   L A T E S T    R E P L I E S    (Newest First)
porter Posted - 12/02/2010 : 10:23:30 AM
Hi Greg,
Thanks for your help! Worked great for me.
greg Posted - 12/01/2010 : 11:01:08 AM
Select column B and choose Statistics : Descriptive Statistics : Statistics on Columns
Choose column A as the Grouping variable
Uncheck everything except Quantities to Compute : Moments : Sum in the dialog and click OK.

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