Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8780947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:10:52+00:00 2026-06-13T20:10:52+00:00

I have this data in a Google DataTable: project1 | system1 | 5 project2

  • 0

I have this data in a Google DataTable:

project1 | system1 | 5
project2 | system2 | 2
project1 | system1 | 5
project3 | system4 | 1

I need to merge rows that have the same projects and systems. So the result would be:

project1 | system1 | 10
project2 | system2 | 2
project3 | system4 | 1

the number must be a sum of the values in the respective columns.

Is there a build in method in the DataTable to achieve this or can somebody give me a hint how to do this without the need of typical iterating through the table and comparing on each row.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:10:53+00:00Added an answer on June 13, 2026 at 8:10 pm

    populate your DataTable and use the group-Function for this: https://developers.google.com/chart/interactive/docs/reference#google_visualization_data_group

    Your example should fit into something like this:

    var result = google.visualization.data.group(
      // input data
      your_data_table_obj,
      // key columns (columns to group by)
      [0, 1],
      // third column (index 2) will be summed
      [{'column': 2, 'aggregation': google.visualization.data.sum, 'type': 'number'}]
    );
    

    One last thing: you are talking about Grouping not Merging. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Google Bar Chart: function drawChart() { var data = new google.visualization.DataTable();
I have this class that tries multiple methods of getting data from Google maps
I have this source data [gallery] Title [galleryitem]http://www.google.com/image.jpg[/galleryitem] [galleryitem]http://www.google.com/image.jpg[/galleryitem] [galleryitem]http://www.google.com/image.jpg[/galleryitem] [galleryitem]http://www.google.com/image.jpg[/galleryitem] [galleryitem]http://www.google.com/image.jpg[/galleryitem] [galleryitem]http://www.google.com/image.jpg[/galleryitem] [/gallery]
I have this data in cell A1: Majestic Properties Design District, LLC, Ste. 101,
i have this data | car_name | year | price | Honda | 2011
I have this data from a xml file: <?xml version=1.0 encoding=utf-8 ?> <words> <id>...</id>
I have this data: /blabla/blabla (abs,def) /yxz I use this regex (.*)(?:\(([^$]*)\))?\n But it
I have this data: 1, 0., 0., 1500. . . 21, 0., 2000., 1500.
I have this data in a table, for instance, id name parent parent_id 1
Let say if I have this data my_data = [ 10 20 30 40;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.