User Guide
×
Menu
Index

Sum and RowNumber Functions

 
There are two additional mathematical functions that can be used with the Table input. The first one is Sum. It will return a sum of all values from the input Table. A good example of where this might be useful would be a calculation of TopX items share for percentage values.
 
 
An interesting use case for the Sum function would be to build a cumulative sum. We can achieve that within a dynamic row with the help of RowNumber function, which returns the position of a row within the Grid. Using RowNumber, we can define Head in a way which will dynamically limit the Table to all the rows up until the current one. Note that “RowNumber() - 2” is used, since this function returns the position of row in the whole table, therefore, in our case we need to subtract 2 rows used as headers. We can then use Sum for the cumulative sum.