how to compute values in chain

Posted on 2011-10-03
Last Modified: 2012-05-12
Hello experts,

Here is my senario, let's assume i have three controls. One is dropdown list which gets data from database. Then there is another control which is computed using some formula based on dropdown list value. Finally there is another control which is computed based off second control. This is just an example, mine is little more complex but this will give me a idea. Above senario can be reprensented as follows:  

Dropdown list (driven from database) => Control one computed based on drop down => Control two computed based on control one

I didn't find anything like label or anything in infopath. I am bit new to Infopath, please help.

Question by:KoolAsIce
    LVL 28

    Expert Comment

    To do this you often use the filter functionality.

    So select a field where value equals the one chosen in the drop down.

    Typically called cascading dropdowns.  You break down repeating data through subsequent selections. has some tutorials on cascading dropdowns.

    Author Comment

    Hi Clayfox,

    thanks for your answer but I am not looking for a cascading dropdowns. Instead im looking for chain of computation.

    For example, dropdown list data is coming from database. However, second control takes that data and does something like multiply that dropdown number with something. Finally there is another control which takes the value of second control and divides it by some number to yield a result for third control and so on.

    Further, once data is populated in third control and now if the value of dropdown list is changed, then second control and third control value should change automatically.

    Please let me know if you have any ideas.
    LVL 8

    Expert Comment

    Hi Kool, try this:

    If I want to multiply field 1 by 4 and divide that result by 3:

    field1 is the dropdown value
    field2 formula is field1 * 4
    field3 formula is field2 / 3

    Make sure there is a space on either side of the /, lest InfoPath consider it a separator instead of a division operator.

    Does that help?

    Author Comment

    hi nsyyoung,

    Thank you for your solution. I already did something like that using infopath control (fx). However, when I do so, once field1 dropdown value is changed after first computation, field2 and field3 doesn't seem to change automatically.

    Also I am wondering, if I can use any other controls beside (fx) for chain computation like Label (but I didn't find any Label infopath :)  

    LVL 8

    Accepted Solution

    There's no "label" control.

    Make sure the box by "Update this value when the result of the formula is recalculated" (in the Default Value section) is checked.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now