Scout Chart Creator
  • Overview
  • Get Started
    • Tutorial 1: NMR Daily Transaction Count
    • Tutorial 2: LPT Weekly Volume (USD)
    • Tutorial 3: NMR vs LPT Daily comparison
  • Pipeline
    • Filter
    • Project
    • Group
      • Accumulators
    • Sort
    • Unwind
    • Custom
  • Data Source
    • Transactions
    • States
    • Contracts
    • Aragon
    • Livepeer
    • dYdX
    • Set
    • Token holders
  • Operators
    • Math operators
    • Logic operators
    • Function operators
    • Array operators
    • String operators
  • Config
  • Protocols
    • Dodo
      • 24H trade volume
      • Deposit & Withdraw
    • Livepeer
    • dYdX
      • Making sense of the trade data
    • MakerDao
    • Pickle Finance
      • Example: Daily deposit and withdraw of jar 0.88
      • Example: Listing all borrows of a strategy
  • FAQ
    • Dealing with "logs" field in "Transaction"
    • How to handle "Query Timeout" error?
    • How to use a variable in a Pipeline
  • Research
    • The circulating supply of DODO tokens
    • How are bitcoins doing on Ethereum? (as of Jan 20th 2021)
Powered by GitBook
On this page

Was this helpful?

  1. Pipeline

Group

To group the input data by one or multiple fields. For each distinct grouping, the output data contains accumulated value from selected fields.

PreviousProjectNextAccumulators

Last updated 4 years ago

Was this helpful?

Group is often used when you try to "bucket" data together.

The first part is called Group by. This is where you specify the fields that should be used to group the input data. The field you select here is called a group key and each group key should be unique. For example, you can group all the transactions by the sender's wallet address.

A group key can also be an object:

If the group key you choose happen to be a timestamp, there will be an extra option for different intervals. It's especially handy when you are building a daily, weekly or monthly chart.

You can put all of them into an array by using push

If you want to get an average value of all the data, you can use average

If you want to get a total value of all the data, you can use sum

For details on how to use "toObject" operator, please refer to the page

The second part is called Accumulation. This is where you decide how the data that's been grouped together should be handled. There is a list of to help you achieve that. Let's look at some simple examples:

Function operators
accumulators
Understand "Group" in 3 minutes
Using an object as a group key
When the group key is a timestamp, additional options for different intervals will be popped up