# I need to Total from two different Form Collapse sections

• District1010
Asked on February 24, 2014 at 09:08 AM

I have two areas where I ask delegates to give a choice of days they will be there and dinners they wish to attend. This means that there will be one of three Totals in each section. I now wish to add those two totals - how do I identify the 'exposed' totals in each of those sections?

Taking just one instance (Delegates)

Using the Screen shot and assuming Choice 1 and let's say that (2) has been set at 6 delegates the would give a total delegate rate (3) of £40 (4) x Number of Delegates (2) = £240. The question / problem is how do I have that £240 transferred to (5) below?

Thanks

• TitusN
Answered on February 24, 2014 at 09:46 AM

Hmmm,

You might get a solution if you broke down your problem into sections, then passed the total to "Total Delegates field Total"

You can add as many hidden fields as possible so as to achieve this as shown below.

For each of these hidden fields (which will never show on a live form), you can calculate a total for each section/day.

Then sum it up on the ""Total Delegates Fees Payable" field.

I hope this advaces things a little further as I wrap my head around what you want to achieve - an equation of sorts would help whip up a demo....

Total fees payable = (X+Y+Z)*Rate  or something like that....

• District1010
Answered on February 24, 2014 at 10:04 AM

Hi Titus

That's a Hmmm, from me too. I have broken it down in as much as only talking about the 'Delegates fee. The section is fully working and if 'we' select Attending 'AllConference it does give the correct Total in Delegate Fri/Sat and at that point Delegate Fri/Sat becomes visible leaving both Friday and Saturday 'hidden'.  Obviously the same story if the Delegate(ss) pick FriOnly.  All I need is the 'exposed' total to be copied into Total Delegate fees Payable, that's the bit I can't quite get my head around - is there a way of totaling using If Field 'A' is Hidden and Field 'B' is hidden SHOW Field 'C" and If Field and so on? Do you think that would work for me?

Soory give me a moment your image has just appeared (it wasn't there before) let me see if I can make something of it first.

Now it's gone again...

Back again

Pity you have removed the Friday Total that you added to my form what was the formula / calculation you would have used?

• TitusN
Answered on February 24, 2014 at 10:19 AM

I see the challenge.

My presumption would be that all the hidden fields show a value of zero, right?

Based on this, why not add them all up in a hidden field then transfer the total to the Total fees due?

All hidden fields would add a 0 value to the total, while the shown fields contribute to the correct total.

****

Can the desired total be expressed in one equation(or two/three)? Field names will do.

I'm thinking of a calculation section that sorts all that out - I once did a non-linear algebraic equation with a bunch of calculation fields.

I would be more than happy to create a demo towards this...

• District1010
Answered on February 24, 2014 at 10:49 AM

That would be very helpful (a demo), not sure if this helps but when I did a very simple a+b+c of the three delegate rates it seems to show that the hidden fields are certainly not zero (more's the pity), in the example I gave the total was £300 which indicates that three calculations still happen even though just one of them showing.

• TitusN
Answered on February 24, 2014 at 12:35 PM

Thanks for clarifying.

I see the problem.

I'm considering a solution, will update you as soon as possible.

• District1010
Answered on February 24, 2014 at 04:02 PM

Look forward to it

• District1010
Answered on February 25, 2014 at 05:50 AM

• TitusN
Answered on February 25, 2014 at 08:01 AM

Hello,

Sorry for the delay.

It took some thought - I think our main problem is that we cannot convert the "Attending"radio buttons responses to a calculable 0 or 1 - which would factor out the hidden totals - right?

I can submit a feature request - not sure whether it will be implemented though -but I am optimistic.

In the meantime, I would advice that you create three total fields which calculate the total for each to the conference day selections separately - then use the conditional logic rules to show'/hide the correct total based on the selection of the "attending" field  - Make sense?

Seems to work:

Here's a demo, its a little choppy - hope it illustrates the workaround -http://jotformpro.com/form/40543694116959

Let us know.

• District1010
Answered on February 25, 2014 at 09:18 AM

Perhaps I have missed something, certainly hope so as we don't appear to have progressed? The attached is your form which I then completed but as you'll note we're missing the Dinners? There is an earlier choice, basically are you staying at the Hotel? If yes then you don't need to complete the dinners that's all part of the package.

• TitusN
Answered on February 25, 2014 at 09:23 AM

Oh no,

I only worked on the concept by calculating the total Delegate fees payable - it was not a reflection on how the complete form is supposed to work.

I will weave it into the demo - in the meantime, you can clone the demo form and take a look at what I've done.

• District1010
Answered on February 25, 2014 at 09:26 AM

Sorry just doing that now I was perhaps a little quick off the mark - let you know.

Cheers

• District1010
Answered on February 25, 2014 at 09:58 AM

First time that I have noticed the Calculation Wizard, rather neat but I assume that it is only a neater way of doing 'norma' calculations? I wonder if it is possible to add a line to some of the conditions which would translate down in to the other section? That to my mind is the real issue here we have used conditions to both hide and expose forms but they are still there in just the same way they will be there when we copy them? Be a bit sad after two weeks to have to go back to the drawing board.  At its simplest I guess we should be able to take either of the calculations and create a Totals Box that reflects the final calculation no matter the choices made?

I wonder if Jonathan is around he may well have realised where this was going to lead?

• TitusN
Answered on February 25, 2014 at 12:51 PM

Hello,

I've got my colleagues in live collaboration - I get a lot of solutions by discussing solutions with them.

I know it feels like a waste with the introduction of the new calculation widget - - but a solution is eminent - bear with us..

We're exploring how to implement the extended functions of the calculation widget. There are some new features I think would be of great use.

****

To begin with,

It always helps when there's an equation to work with.

Here's what I have so far:

1. Total Delegate Fees Payable = Total Dinners Payable+ Total conference Payable

2. Total Conference Payable = IF (Delegates *Conference Rate Friday) + IF (Delegates *Conference Rate Saturday) + IF (Delegates*Conference Rate Fri/Sat)  [IF is 1 when selected, 0 if not]

3. Total Dinner payable = IF (Delegates *Friday Dinner Rate) + IF ( Delegates * Saturday Dinner Rate) + IF (Delegates *Fri/Sat Dinner Rate)  [IF is 1 when selected, 0 if not]

Sounds about right? Can I go ahead and model this solution in a demo?

• District1010
Answered on February 25, 2014 at 01:06 PM

Hi there

Sounding good but let me change those formulas a little, but first an explanation.

Conference will be attended by a number of people, all are called 'delegates'

All Delegates have to register with this form and they all have to pay Delegate Fees Day 1, Day 2 or both days

some Delegates will stay in the Hotel and these people will pay the hotel directly for their accommodation and their food. They have no requirement to pay other than the 'Delegate fees'

People not staying in the Hotel may wish to attend the evening Dinners:  Friday, Saturday or both.

Therefore, I have a 'small' problem with 1. above

1. Total Registration Fees Payable = Total Dinners Payable + Total Delegate Payable

2. Total Delegate Payable = IF (Delegates *Conference Rate Friday) + IF (Delegates *Conference Rate Saturday) + IF (Delegates*Conference Rate Fri/Sat)  [IF is 1 when selected, 0 if not]

3. Total Dinner payable = IF (Delegates *Friday Dinner Rate) + IF ( Delegates * Saturday Dinner Rate) + IF (Delegates *Fri/Sat Dinner Rate)  [IF is 1 when selected, 0 if not]

That seems OK just as long as Total Dinners Fee can equal zero when a Delegate stays in the Hotel?

You're making my day I think.

• TitusN
Answered on February 25, 2014 at 02:32 PM

Thank you for the response.

Just one more thing - how do you determine that the delegates will pay for their own hotel, and by extension not partake in the Fri/Sat dinners?

As it stands, they have to select at least one of the three dinner options

Idea:

Thanks -

• District1010
Answered on February 25, 2014 at 03:22 PM

That's an easy one. Just following the list of Delegates there is a drop-down Q

Are you staying in the Dunblane Hydro? Y/N

If Yes then the section Dinners is hidden and just Delegate Registration shows. Dinners the title (staying outwitch Dunblane Hydro)

If a No then both Dinners and Delegation Registration sections will show.

Hope that's clear?

• TitusN
Answered on February 25, 2014 at 03:42 PM

That's prerfectly clear - thanks.

I will return.

We have quite a bit of support requests in the inbox - please allow a little time and we will work on your demo.

Thanks, you've been really patient.

• District1010
Answered on February 25, 2014 at 03:47 PM

Thanks for letting me know. I have just realised that the title of this thread says it rather well

"I need to Total from two different Form Collapse sections"

I am about to leave for something else now so hopefully your answer will be waiting for me in the morning.

• District1010
Answered on February 26, 2014 at 05:27 AM

Just reporting in - I tried to wait longer...

• TitusN
Answered on February 26, 2014 at 07:09 AM

Sorry, My morning could be a little different from yours.

Running some tests, will present the demo in a little while.

Thanks for waiting.

• District1010
Answered on February 26, 2014 at 07:42 AM

Probably a little busier I suspect, look forward to hearing back from you shortly.

• TitusN
Answered on February 26, 2014 at 07:56 AM

I'm back.

Now - I've removed all your show/hide conditional rules that have to do with the calculation fields, we'll add them later... at least you can see all the calculations in action.

I had to split the dinner/Conference choice selections into three fields - and hid number values in the Yes and No responses, such that Yes=1 and No = 0

This enables us to validate or invalidate unselected options in the calculation...

Anyway - here's the form with the calculations all running according to the equations you confirmed yesterday:

http://jotformpro.com/form/40543694116959

Let us know.

• TitusN
Answered on February 26, 2014 at 08:00 AM

This does not reflect on how the form should work as a whole, but just the calculations - we'll tackle the challenges one at a time.

• District1010
Answered on February 26, 2014 at 08:13 AM

I think that I can see what you are trying to do.

First time I selected 7 delegates and ticked the box to say thay they weren't staying in the hotel and therfore both Dinners and Delegate rates should be there

Dinner Rate doesn't appear to be working?

Delegate Rate - seems OK at a basic level but as you say it will need to tied up

• District1010
Answered on February 26, 2014 at 08:22 AM

Just tried another route If I leave staying at the Hotel as Yes the maths is fine. You simply have the choice the wrong way around

If staying at the Hotel Then no dnners are needed (they are included)

• TitusN
Answered on February 26, 2014 at 09:34 AM

Its easy for me to get it wrong - I don't have the grand scheme of things in mind...

I've fixed the yes-no dinner-rate show/hide rule  - reversed the logic.

go ahead and clone the form and take a closer look - don't worry about the numeric values in the no/yes responses - they will not show on the live form - they are only used in the calculation variables:

I had to remove all the show/hide rules because I did not know how to approach that and demonstrate the calculation function at the same time

I hope this helps...

• District1010
Answered on February 26, 2014 at 09:54 AM

Ignore this it's OK -

----------------------

I  seem to have lost the drop-down as shown above.  Perhaps because i removed the original from from my area and attempted to replace with yours from 07:56?  What exactly did you do to reverse the logic (explian the '1' and '0') please.

------------------------

The maths works but it falls apart when / should the delegate begin to change his/her mind but perhaps I should expect that as some of these may be hidden in the final version?

Where do you suggest we tackle next?

• TitusN
Answered on February 26, 2014 at 11:00 AM

Yes, that's true.

You can opt for two options -

1. Clearing the form and beginning from scratch

2. Add a checkbox that they will use to review their answers, which will reveal the relevant hidden fields using the conditional wizard:

*****

About the 1/0 values in the Yes/no fields - I have placed them inside <em></em> html elements (which is why they look italicized) and inserted CSS to make them invisible.

Thats why they are invisible on the live form.

So the Calculation widget extracts the invisible numerical value (0 or 1) in the option label, and applies it as a factor to the calculation:

Does this progress things? - standing by...

• District1010
Answered on February 26, 2014 at 11:47 AM

Keep it simple, clear the form and start again would certainly fit the bill.

Peter

• District1010
Answered on February 26, 2014 at 04:12 PM

OK, it seems that I am on track now, I an making full use of the 'hide field' feature which has perhaps removed the original issue when using Collapse Fields. My only concern, and it's a small one, is the need to have three drop downs to ask what amounts to the answer to one question? Is there a better / tidy way than this?

http://www.jotform.com//?formID=40563500675957

My form has all but disappeared with most stuff hidden.

I have noticed an error though that whilst the Are you staying in the hotel? Drop down is a required field it matters not perhaps it needs a default entry? It certainly screws up the total payment when delegates are staying at the hotel.

• jonathan
Answered on February 26, 2014 at 08:16 PM

Hi Peter,

My only concern, and it's a small one, is the need to have three drop downs to ask what amounts to the answer to one question?

Can you please elaborate this question further? Where can we find this on the form http://www.jotform.com/40522810865957

I have noticed an error though that whilst the Are you staying in the hotel? Drop down is a required field it matters not perhaps it needs a default entry?

I am sorry, but I could not seem to find the hotel dropdown field. Can you guide where it is.

You can use screenshot to help us have visual on the part where you are having issue.

You can upload your screenshot images here http://tinypic.com/ then just share to us the URL of the uploaded images in your message. This way we can see it also.

We will wait for your update.

Thanks!

• District1010
Answered on February 27, 2014 at 02:30 AM

Hello Jonathan

A lot of water has gone under this bridge and there have many toings and froings to the point that my form works but not quite as tidy as it initially was when we had a series of collapses constructed with you help, but we couldn't get the form to pass totals from those sections, after the best part of a week we are where we are. That said time is fast reaching the point where I will have to run with whatever I end up with. Anyway to answer your questions.

Just to finish this off, my form is working and all the calculations do the expected thing, which I appreciate Titus for his work with me on this. The ONLY issue I have are those three drop downs and even then they do work just not foolproof in the sense some daft Rotarian could say YES to all six questions...

This choice is basically means that if the delegate(s) are staying at the hotel they don'y need to book Dinners - that's done on booking with the Conference hotel (outside this form)

If NO then they will need to book Dinners.

and it follows if YES they will still need to pay Delegate Fees as indeed does everybody

From the two results we move down to the totals (for payment)

Hoefully clear now?

• District1010
Answered on February 27, 2014 at 05:34 AM

On reflection it might be as well to kill this thread off. I've learn a lot and perhaps best left at that.

Thanks

• TitusN
Answered on February 27, 2014 at 07:29 AM

:-) Here when you need us.

• District1010
Answered on February 27, 2014 at 07:32 AM

Hi Titus

Well I certainly do now take a look at the New Calculation Widget thread I recently started - I seem to have a step backwards this morning.

• TitusN
Answered on February 27, 2014 at 07:34 AM

Copy.