Jump to content
  • 0

creating a formula for a scenario



Very very new and trying to create a formula for the TOTAL field, can anyone help  ?

If the PART field and the DETAIL field  match on seperate rows, then sum up their  QUANTITY fields

example from image below on 2nd and 3rd rows      PART:blowdown pipe  and DETAIL:dirty   match so add up the quantities  from each row and calculate a total.


Hope this makes sense




Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello @Jason200,

You may try following these steps:

1. Create a new field in the table to concatenate the PART field and the DETAIL field. To do this, please use formula DataType for the field with a simple formula: [@field:PART]+[@field:DETAIL]. 
Let`s say the name of the formula field is Concat_Field

2. Go to the DataPage -> Configure Results Page Fields. Please add a Calculated field, which you can name TOTAL.

Please try this formula for the Calculated field:

SELECT TOP 1 SUM(QUANTITY) FROM table_name WHERE Concat_Field = target.[@field:Concat_Field]

Please, replace "table_name" with your table name and check the field names. 

For the better visualization you may use the Data Grouping option on the DataPage (if it is available in your plan).

You may refer to the article: https://howto.caspio.com/datapages/reports/advanced-reporting/data-grouping/


I hope that this information is helpful. 


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