Jump to content
  • 0
Sign in to follow this  
astroboy

Formula to get the percentage contribution of each record

Question

 Hello, I would like to create a formula/calculation that will allow me to show what percentage each record into a field contributes to the total sum of that field. Is that possible in Caspio?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You may try this formula, however, this only works on the DataPage level:

([@field:NumberField]/(SELECT SUM (NumberField) From Table))*100

Please make sure to replace the field names according to your table design.

Share this post


Link to post
Share on other sites
  • 0
Just now, princezuko said:

You may try this formula, however, this only works on the DataPage level:

([@field:NumberField]/(SELECT SUM (NumberField) From Table))*100

Please make sure to replace the field names according to your table design.

This works! But I have another question.

I noticed that it is calculating the percent contribution to the entire table but I only want to calculate the percentage for the displayed data which is being filtered by another field, say a company name.

Share this post


Link to post
Share on other sites
  • 0

If you want to calculate the contribution for a specific filter, you may try adding a Where criteria that utilizes 'target'.  You may refer to this formula:

(([@field:NumberField]/(SELECT SUM (NumberField) From Table))*100 WHERE Company_ID=target.[@field:Company_ID]))

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...