Is It Possible to Aggregate Values Based on Grouping Bundles by Matching Parameters across different bundles?
I’m working on a scenario in Make where I need to retrieve data from a CSV file stored on Google Drive and then process the data. The goal is to sum a specific parameter (customer_charge
) for bundles that meet certain criteria, and then export the aggregated result to Google Sheets.
The process involves the following steps:
- Retrieve the file from Google Drive: The CSV file is stored in Google Drive. I use the “Google Drive: Download a File” module to pull the file into my workflow.
- Parse the CSV: The file is parsed into individual bundles using the “CSV: Parse CSV” module. Each bundle contains various fields, including a
customer_charge
value and other parameters likecountry
,payment status
, ‘date’. - Sum the
customer_charge
values: I want to sum up thecustomer_charge
values for the bundles that have the status set as:“Paid”, and that have the same date and country fields. The sum should be based on the condition that specific parameters (e.g.,country
,date
) match across different bundles. Basically if status=Paid then for each bundle with the same date and country do a sum of customer_charge values. - Export to Google Sheets: Once the sum is calculated, I need to export the results to a Google Sheets document for further use.
I currently have problems with ensuring that only bundles with matching parameters are aggregated together. If this where SQL
SELECT
country,
date,
SUM(customer_charge) AS total_charge
FROM
your_table_name
WHERE
payment_status = ‘Paid’
GROUP BY
country,
date;
|country | date | total_charge|
|LV | 31-12-25 | 1000.99|
|HR | 31-12-25 | 500.00|
|LV | 01-01-25 | 250.00|
|HR | 01-01-25 | 300.00|
this would have solved the problem :))