Jason Spanomanolis
unread,Apr 17, 2023, 12:08:52 PM4/17/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Apps Script Community
I am using Apps Script in conjunction with the Google Sheets API to create a pivot table in Google Sheets. While I am able to create the pivot table and add values, I am having trouble creating a custom field that calculates the click-through rate (CTR) by dividing the number of link clicks by the number of impressions. When I add the custom field to the pivot table using the following formula:
{ "formula": "=sum('Link clicks')/sum(Impressions)", "name": "CTR", "summarizeFunction": "SUM" }
The custom field is created successfully, but it just outputs the value "0.0" in all cells, instead of the expected CTR values. I have tried updating the formula to reference the column index instead of the header name, as well as removing the summarizeFunction parameter, but the issue persists. Does anyone know why this might be happening, or have any ideas for a solution? Thank you in advance for your help!