Running total for a repeating section

W

Wenster

I'm a fairly novice user with very little code experience. I have a form
with a repeating section. I would like to be able to maintain a running
count of the number of sections that get added by a user - essentially I want
to see "Section N of N"

Here's what I have:
expression box with formula - position() --- this gives me the ability to
increment each section as a user adds it. (so Section N)

I also want to be able to count how many sections a user adds and ensure
that all the added sections use the same count.

So if 1 section is entered into the form - Slide 1 of 1

If another section is added to the form Slide 1 changes to reflect - Slide 1
of 2 and Slide 2 shows Slide 2 of 2. Again, I've used an expression box to
create the "Slide x" piece and i cannot figure out how to get the second
number.

My data source looks like this:
myfields
--Slides General (Group)
--Slide Properties (repeating group)
--Slide Total (field)

Slide Total is the field that I am trying to use to calculate total number
of repeating sections that a user adds.

Your help is much appreciated!
 
S

Swathi (GGK Tech)

Hi,
Use the following expression in the expression box.
concat(“Section “, position(), " of ", count(/my:myFields/my: Slides
General /my: Slide Properties)) -- it will give the expression like
Section N of N.
If you want only total number of rows then use the following expression.
count(/my:myFields/my: Slides General /my: Slide Properties)
 
A

Anuma(GGK Tech)

Hi,

Try this:
Add "count(repeatinggroup)" function to the "Total" field. This will show
the total number of repeating rows inserted. Make sure this field will be out
of the repeating group.

repeatinggroup --> Repeatinggroup node name for your repeating section.
 
W

Wenster

Thanks so much! This worked perfectly!

Anuma(GGK Tech) said:
Hi,

Try this:
Add "count(repeatinggroup)" function to the "Total" field. This will show
the total number of repeating rows inserted. Make sure this field will be out
of the repeating group.

repeatinggroup --> Repeatinggroup node name for your repeating section.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top