Jump to content
  • 0

I need to calculate the average in a pivot-table grand total row



I need to calculate the average of the values in the right column, this is a pivot table (IMG1). I can't find a way to do this, also using "Totals and aggregation", and  COUNT (DISTINCT ) function to count how many different values are there in the row on the left (as the Pivot Table does) and then divide that number for the sum of the values in the right column is not feasible, because the (DISTINCT) part of the function behaves in a strange way: when I verify it it says "valid function"(IMG2), but then when I load the data page, i get the message "Error in formula" instead of the datas


Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello @Alessandro,

Please test the formula using the SELECT statement.

For example:

(SELECT SUM(Field_1) FROM Table_Name) /(SELECT COUNT (DISTINCT Field_2) FROM Table_Name)

Please replace field names and table name with your local names. And please note that if you use a View and not the table, you need to use _v_ prefix before the View name. 

You may want to check this article https://howto.caspio.com/datapages/reports/advanced-reporting/calculations-in-forms-and-reports/

Hope this helps

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...