Knowledge: Using repeater in calculated field to total several rows
Back
    Title*Using repeater in calculated field to total several rows
    ManualAdministration
    Manual Level TwoData Rooms
    Manual Level ThreeForms Design
    Created24/06/2020
    Detail

    This example shows how to add numbers together from within a repeater.

    OnSave Formula

    Below is the formula you need. XmlField1 should be the underlying database field for your repeater.

    cast(XmlField1 as xml).value('sum(!Xpath!)', 'float')

     

    Add a repeater xpath (use !Xpath! to insert in to formula)

    In the below we are targeting NumberField1 as the underlying field for values you want to total. Please replace with your required number field database value. 

    //RepeaterData/Repeat/*[@DatabaseValue="NumberField1"]/@Value

     

    Adding extra conditions

    If you need to restrict the totalled rows to ones where another field in the repeat is set to a specific value, the following format can be used:

    //RepeaterData/Repeat[Data/@DatabaseValue="TextField1" and Data/@Value="example"]/Data[@DatabaseValue="NumberField1"]/@Value

    Manual
    Tips and Tricks
    Privacy Policy
    Cookies help us to improve your user experience. By using this site you consent to cookies being stored on your device. Read more...
    Back to Top
    View or hide all system messages