Display the max value of a text field in a repeating table - InfoPath Dev
in

InfoPath Dev

Display the max value of a text field in a repeating table

Last post 03-27-2008 09:28 AM by thoness. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 03-03-2008 03:56 AM

    Display the max value of a text field in a repeating table

     Hello all (again),

     I have a problem again with one of my forms.

    I have a repeating table that has to dropdowns and a text field. The text field is automatically takes a numeric value.

    So if my repeating table has 5 rows the text field could have these values : 1,5,11,2,9

    I want to display the highest value of these five (in our case : 11) in another text field outside the repeating table.

    Is that possible ?

     

    Many thanks,

     

    Alex
     

  • 03-03-2008 11:05 AM In reply to

    Re: Display the max value of a text field in a repeating table

    Create a default value formula for the text field and use the max() function:

    max(/table/row/field)

  • 03-03-2008 02:00 PM In reply to

    Re: Display the max value of a text field in a repeating table

    Many many thanks Greg ! 

  • 03-04-2008 09:24 AM In reply to

    Re: Display the max value of a text field in a repeating table

    Glad to be able to help!

  • 03-17-2008 05:56 AM In reply to

    Re: Display the max value of a text field in a repeating table

    I am needing the max value of a field to display and add one to that number. This will be working as a transport number in this case and needs to be calculating and set. Also I am needing to use my own starting number.

     Right now it doesnt seem to want to show anything.

    max(@TRANSPORT_NUM)+1 is what I am trying to work with.

     Any suggestions.

  • 03-17-2008 04:22 PM In reply to

    Re: Display the max value of a text field in a repeating table

    First verify that max(@TRASPORT_NUM) is returning a valid number. If not, see what's wrong there.

    If it is returning a valid number, then try adding a space between the max() and the +1: max(@TRANSPORT_NUM) + 1 ---sometimes that can actually make a difference, as weird as that sounds.

  • 03-17-2008 04:26 PM In reply to

    Re: Display the max value of a text field in a repeating table

    I just made a quick test form and it worked just fine without adding the space... make sure that you max function is returning a valid number.

  • 03-18-2008 04:17 AM In reply to

    Re: Display the max value of a text field in a repeating table

    I tested with just the max() value and it was fine. added in +1 and get this.... 1.#QNAN

  • 03-18-2008 11:10 AM In reply to

    Re: Display the max value of a text field in a repeating table

    1. What kind of values are in @TRASPORT_NUM? Just numbers?

    2. Are there ANY rows of @TRASPORT_NUM at all when you get this error value?

    3. Are there any rows of @TRASPORT_NUM that have non-numeric values?

    I don't get 1.#QNAN, but if I have no rows, or any rows that have non-numeric values, I get NAN. This is expected.

  • 03-27-2008 09:28 AM In reply to

    • thoness
    • Not Ranked
      Male
    • Joined on 03-26-2008
    • Seattle, WA
    • Posts 25

    Re: Display the max value of a text field in a repeating table

    Sorry to keep tacking on to this thread.  But my situation is similar.  I have two nodes, Total C and Total I each with a sum function to create a numerical value.  I have another node, TotalAssets which takes a max value between the two said nodes.  I can't get the syntax right to allow the max between two fields so I put the two fields in a group, called Totals_B and took the max of that group.  I got it to work once however after I did some cleanup, I now get NaN as the value of my max.

    xdMath:Max(../my:Totals_B)

     I tried making a rule that if Total C is greater then TotalI then use TotalC value for my TotalAssets node and vice versa.  But the rule would only apply if you put a value in that TotalAssets node.

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