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 for Programming
 LabTalk Forum
 How to GROUP&SUM column data (group by)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

porter

Canada
4 Posts

Posted - 12/01/2010 :  02:06:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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


greg

USA
1379 Posts

Posted - 12/01/2010 :  11:01:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

porter

Canada
4 Posts

Posted - 12/02/2010 :  10:23:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Greg,
Thanks for your help! Worked great for me.

Edited by - porter on 12/02/2010 10:24:56 AM
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