Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7127853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:04:35+00:00 2026-05-28T11:04:35+00:00

It is easy to calculate a sum, an average or a maximum accross set

  • 0

It is easy to calculate a sum, an average or a maximum accross set of fields using built-in xpath functions.

But is it possible to calculate a product?

Assuming I have repeating elements like

<my:table>
    <my:row>
        <my:value>10</my:value>
    </my:row>
    <my:row>
        <my:value>20</my:value>
    </my:row>
    <my:row>
        <my:value>30</my:value>
    <my:row>
</my:table>

(the number of my:rows may vary).

i need to have a formula multiplying all my:values: 10*20*30 (and working with any number of rows).

Any ideas?

Please do not suggest code solutions, I need this for a restricted form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:04:36+00:00Added an answer on May 28, 2026 at 11:04 am

    Using conditional hack described here, I finally assembled the solution.

    Inside my:row, create a running product field my:valueCumul, populated using a formula to refer to previous row, and leveraging the conditional hack to override NaN for the first row:

    ../my:value * 
    concat(
    (count(../preceding-sibling::my:row[1]) = 0) * 1,
    substring(../preceding-sibling::my:row[1]/my:valueCumul, 1, (count(../preceding-sibling::my:row[1]) = 1) * string-length(../preceding-sibling::my:row[1]/my:valueCumul))
    )
    

    Outside the table you can easily refer to my:valueCumul in the last row to get total product:

    ../my:row[count(../my:row)]/my:valueCumul
    

    The nice features of this solution are:

    • Works in a browser form in any sharepoint environment
    • Is not impacted by “16 calculations” threshold
    • The formula is robust to row removal and shifts
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure there is a quick and easy way to calculate the sum of
Is it possible to calculate the row position in the cartesian product of two
Is there any easy way to calculate the number of lines changed between two
An easy problem, but for some reason I just can't figure this out today.
Here is probably an easy question.. but I am really struggling so help is
I am trying to solve a combinatorics problem, it seems easy, but i am
I am trying to calculate the vertices of a rotated rectangle (2D). It's easy
Given a sequence of a group id/value tuples, it was easy to calculate group
Is there an easy and fast way to calculate the rank of a field
Is there a easy way to calculate the grand total of all the numberic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.