Count for each distinct value - InfoPath Dev
in

InfoPath Dev

Count for each distinct value

Last post 04-22-2009 12:12 PM by jeanpaulhanna. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-17-2009 12:53 PM

    Count for each distinct value

    I have a repeating table where I am filtering by distinct value

    not(my:LIEN_TYPE = preceding::my:LIENS/my:LIEN_TYPE)

    I need to display a count for each unique value

    Example:

    Below are the values in my table:

    Building Loan Agreement
    Lis Pendens
    Building Loan Agreement
    Building Loan Agreement
    Lis Pendens
    Mechanics Lien

     It should display like the following:

    Building Loan Agreement   3
    Lis Pendens  2
    Mechanics Lien 1

    Currently I am able to display the list of unique values but I am not able to get a count on each

    Please help
     

  • 04-17-2009 09:56 PM In reply to

    Re: Count for each distinct value

    Hi,

    Add an expression box/ text box to the form. Add the below expression as default value.

    count(../my:group1/my:group2[my:field1 = "Building Loan Agreement"])

     

    Here group2 is the repeating table and field1 is the field value which stores the values you have mentioned (Building Loan Agreement, ..)

    The above expression will give the count for ‘Building Loan Agreement'.

    Use the same for other values by replacing the ‘Building Loan Agreement' value with ‘Lis Pendens' / ‘Mechanics Lien'

    Swathip
    www.ggktech.com
  • 04-18-2009 03:40 PM In reply to

    Re: Count for each distinct value

    thank you for your reply....

    That would work if the values were static....the list that  I provided was just an example of the values, and I will not always know what values will be.

  • 04-22-2009 12:12 PM In reply to

    Re: Count for each distinct value

    I figured it out....

    count(../my:LIENS[(my:LIEN_TYPE = current()/my:LIEN_TYPE)])

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