Calculations within a repeating table - InfoPath Dev
in

InfoPath Dev

Calculations within a repeating table

Last post 07-21-2008 08:16 AM by dichio. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-21-2008 03:59 AM

    • dichio
    • Not Ranked
    • Joined on 07-21-2008
    • Posts 3

    Calculations within a repeating table

    Hi,

    I am new to InfoPath and have the foolwing requirement:

     I have a repeating table:

    Name    |      Total      |      Hourly   |   Type

    Name1 |      20          |                   |   Type1

    Name2 |      44          |                   |   Type2

    Name3 |      88          |                   |   Type2

     

     And 3 other fields

    Total 1 = 55

    Total 2 = 66

    Total 3 = 77

    What I am trying to achive is the following within the Hourly field in the repeating table:

    Name1  = total / (total 1 + total 2)

    Name2  = total / (total 1 + total 2 + total 3)

    Name3  = total / (total 1 + total 2 + total 3)

    Which are conditional on the Type.

    What would the best way of achiving this?

    I've been round and round in circles.

    Thank you in advance.

     

  • 07-21-2008 05:39 AM In reply to

    Re: Calculations within a repeating table

    Hi,Put a Rule on the Type field which includes the following steps.1.    Double Click on ‘Type’ field . Go to Rules.2.    Click on ‘Add’ then Click on ‘SetCondition’.3.    In that select the ‘Type’ field in FIRST DROPDOWN ‘isequalto’ in SECOND DROPDOWn and ‘Type1’ in THIRD DROPDOWN.4.    Click on ‘AddAction’, select ‘set a fields value’ in ‘Action’ drop down.5.    Select the ‘Hourly’ field in ‘Field’ Drop down.6.    Add the following in the Value field.a.    Total / (total1 + total2). Here Total, total1, total2 are the field names.Repeat step2 to step 6 for setting the ‘Type2’. Just change the ‘Type1’value with ‘Type2’ in step3. And Total/ (total1+ toal2 +total3) in step 6.
    Swathip
    www.ggktech.com
  • 07-21-2008 06:07 AM In reply to

    • dichio
    • Not Ranked
    • Joined on 07-21-2008
    • Posts 3

    Re: Calculations within a repeating table

    Thank you very much for your quick response.

     I've been through your guide step by step and it doesnt seem to be populating the Hourly field.

    The setup at the moment requires the "Run Query" button to be pressed to populate the form.

    Could this be the reason it isn't populating the Hourly field??

     Thank you.

  • 07-21-2008 06:40 AM In reply to

    Re: Calculations within a repeating table

    Didn't you get the ‘Hourly’ value even for ‘Type1’?

    First enter all fields then enter the value in Type.

    Let me know if you still not get the value.

     

    Swathip
    www.ggktech.com
  • 07-21-2008 08:16 AM In reply to

    • dichio
    • Not Ranked
    • Joined on 07-21-2008
    • Posts 3

    Re: Calculations within a repeating table

    Not even for Type1.

    But does it require the user to interact with the feilds before the rule fires.

    I'm just thinking maybe it would be better doing the calculations in code behind within Visual tools for applications??

     

    Thank you.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.