Jump to content
  • 0

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


Alessandro

Question

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

1019139438_Schermata2022-01-12alle17_06_44.thumb.png.0d982d4bd53126de2a74608741cd52f8.png1383513642_Schermata2022-01-12alle17_19_36.thumb.png.fd2fe51fed47ab3206dc1ec419c99cb9.png1019139438_Schermata2022-01-12alle17_06_44.thumb.png.0d982d4bd53126de2a74608741cd52f8.png1335536884_Schermata2022-01-12alle17_19_48.thumb.png.3fb29d5dd2125660b2fa8b8cdc988caf.png

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. 
BHjMlPN.png

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.

Guest
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.

Loading...
×
×
  • Create New...