function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
beener3beener3 

SOQL Aggregate Functions to CSV

Hi,

 

I'm aware that from Sprint '10, new aggregate functions (SUM, MAX) will be available for SOQL queries.

 

That's great. now does anyone know how I would be able to export this data to a CSV / excel?

 

Basically, I need to generate different CSV / Excel documents based on queries that use aggregate functions.

 

The Salesforce Report Tool is useless, since if groupding is done, it cannot be generated to PDF, and even if generated to Excel, detail information isn't shown on the totalled row.

 

Any ideas?

 

Thanks

 

Ben 

JoAnnHospiraJoAnnHospira

Hi Ben,

 

I'm curious if you were able to solve this - I have the same requirement on a project I'm working on.  I have found a couple of solutions in the community but wondered if you went about it the same way or if you found another way to manage it.

 

Thanks!

 

JoAnn

beener3beener3

I've yet to solve this.

I would be interested to find how you have.

 

Thanks.

JoAnnHospiraJoAnnHospira

I"ve gotten as far as the solution suggested in this post:  http://community.salesforce.com/t5/Apex-Code-Development/How-to-export-data-to-CSV-file-using-Apex/m-p/167910#M25511

 

I'm working on the controller to get the object/fields that I want and then just need to figure out how to save the file instead of opening it up.  Will keep you updated.