JungleDocs | Count function

In JungleDocs you can use the Count function to get the sum of values in lists. In this tutorial, you will learn how to do this.

Count(recordSet) - returns the number of values in the list of arguments (recordSet).

RecordSet can be arguments or any function that returns a set of items (for example, GetView), within which you want to count numbers or values. 

Note: Count() function in JungleDocs is similar to Totals in list views.


To calculate sold licenses of any product you can use the Count and GetView functions.

Format example: Count(GetView("ListName"; "ViewName"))

Note: If the library where the final document will be generated is not at the same subsite as the list of data, you need to provide a path to that list in the formula, like in the examples below. If library and list are on the same subsite, providing just ListName is enough.

For example, if you want to count all items in the list view of "ProductA" in the "Licences" list which is on the "Sales" subsite, your function would be:

Count(Getview("/Sales/Lists/Licenses/"; "ProductA"))

You can calculate this value in percentages as well. All you need to do in this case is multiply by 100 and divide by the total number of items in the list ("AllItems" view). Your formula then, should look like this:

Count(Getview("/Sales/Lists/Licenses/"; "ProductA"))*100/Count(GetView("/Sales/Lists/Licenses/"; "AllItems"))

If you want more clarity and round numbers, you can round up your results to 2 digits. For this use the Round(value; digits) function:

Round(Count(Getview("/Sales/Lists/Licenses/"; "ProductA"))*100/Count(GetView("/Sales/Lists/Licenses/"; "AllItems")); 2)

Still need help? Contact Us Contact Us