Default/Conditional Value in Repeating Tables - InfoPath Dev
in

InfoPath Dev

Default/Conditional Value in Repeating Tables

Last post 05-15-2007 06:58 AM by dannylam4. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-11-2007 09:43 AM

    Default/Conditional Value in Repeating Tables

    I hope this is in the right place... and not a repeat...

    But anyway, I have this repeating table all set up, with values and such in it. Since I can't exactly describe what's in the table without breaking policy, I'm going to use an example:

    So this table consists of payrolls for employees, listing off how much they make and the different types of taxes. Now we want to see the total of every column, see how much all the employees are earning, see the sum of the taxes, but we want to exclude someone from the table (we'll say his name is David Lee). Okay, so the table consists of "Name" "AmountMade" "Tax1" "Tax2" "Tax3". At first, we just wanted David Lee's section to disappear from the table all together, so I hid him, but hiding him doesn't remove him from the Summation, so I was wondering if there's a way to make "AmountMade" "Tax1" "Tax2" and "Tax3" default to 0 when the "Name" is equal to "David Lee". I've tried doing:

    (0)[../@Name="David Lee"]

    but that just makes ALL the tables default to 0.

  • 05-11-2007 12:45 PM In reply to

    Re: Default/Conditional Value in Repeating Tables

    How I would approach this is add a field to your table, called include or display or hide, etc. I would probably make it a boolean but sometimes an integer is nice so that you can calculate how many are excluded, say if equal to 1 is exclude, these could be summed and subtracted from the total records.

    This would act as a flag to include or exclude a record.  Then you can use this field for both your conditional formating and for your summation functions.  So sum(amountmade[./exclude=0]),  not xpath, but a logic example.

     Hope this helps and welcome to the forums.

    Filed under: ,
  • 05-14-2007 05:42 AM In reply to

    Re: Default/Conditional Value in Repeating Tables

    I have no idea how that is done, haha. You wouldn't know any tutorials to help me do what you just explained do you? Unless you want to try and explain it yourself. (I am VERY newb to this, I've only been doing this for... 4 business days? And thanks for the welcome.)
  • 05-15-2007 03:36 AM In reply to

    Re: Default/Conditional Value in Repeating Tables

    Hi dannylam4,

    Clay's aim is, take a field with name include or display or hide, etc. with TRUE as default value in the schema and take it as boolean, say for example include so that it accepts either TRUE or FALSE. Now set the field value to FALSE to whom you want to exclude from the sum.

    while summing take the function like this sum(AmountMade[./include != 'FALSE']).


    Hope this will help you

    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 05-15-2007 06:58 AM In reply to

    Re: Default/Conditional Value in Repeating Tables

    Ahh, I worked out my issue, and it was a lot simpler than I thought. All I had to do was create a filter while summing the "AmountMade" section. The formula turned out to be sum(AmountMade[./Name != 'Bob']), and it turned out that my problem was in the fact that my old formula didn't have the ./ for the name... Funny how things work out. Thanks very much though! I'll implement both and see which my boss prefers.

    Thanks Muchly,
    Danny Lam

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