Count filtered results in a repeating table - InfoPath Dev
in

InfoPath Dev

Count filtered results in a repeating table

Last post 01-16-2014 07:19 PM by L Mac. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-14-2014 11:41 PM

    • L Mac
    • Not Ranked
    • Joined on 01-14-2014
    • PNG
    • Posts 16

    Count filtered results in a repeating table

     I have a repeating table displaying filtered results, I want to count the results displayed. The table is displaying the desired results.

    I have set a field to count these results using   count(../../dfs:dataFields/d:Issues/@Resolution[../../dfs:dataFields/d:Issues/@Resolution != "Fixed"])

    This returns an error    "../../dfs:dataFields/dfs:dataFields/d:Issues/@Resolution" does not point to a valid location path of a field or group

    Please help.

    Using     count(../../dfs:dataFields/d:Issues/@ID[../../d:Issues/@Resolution != " Fixed"])   the count returns a result, but not a filtered result.

  • 01-15-2014 07:24 AM In reply to

    Re: Count filtered results in a repeating table

    Maybe:

    count(../../dfs:dataFields/d:Issues[@Resolution != " Fixed"])

    If you want, you can attach your form under the Options tab and I'll take a look. :)

    Hilary Stoupa

  • 01-15-2014 01:10 PM In reply to

    • L Mac
    • Not Ranked
    • Joined on 01-14-2014
    • PNG
    • Posts 16

    Re: Count filtered results in a repeating table

     Fantastic!!  Makes me feel a little silly when its that simple.

    Thanks for the assistance

    L Mac.

  • 01-16-2014 04:57 PM In reply to

    • L Mac
    • Not Ranked
    • Joined on 01-14-2014
    • PNG
    • Posts 16

    Re: Count filtered results in a repeating table

     Hilary,

    Same count in a different form, this time the data source is secondary. Using rules I set the following Count:

     count(xdXDocument:GetDOM("Maintenance")/dfs:myFields/dfs:dataFields/d:Issues[xdXDocument:GetDOM("Maintenance")/dfs:myFields/dfs:dataFields/d:Issues/@Project = . and xdXDocument:GetDOM("Maintenance")/dfs:myFields/dfs:dataFields/d:Issues/@Resolution != "Fixed"])

    This draws no errors, but returns a value of zero. Is there a problem in the logic? Or am I missing something simple again?

  • 01-16-2014 06:18 PM In reply to

    Re: Count filtered results in a repeating table

    You are using absolute XPaths instead of relative, and probably need current() here instead of the ".". I'd guess something like:

     count(xdXDocument:GetDOM("Maintenance")/dfs:myFields/dfs:dataFields/d:Issues[@Project = current() and @Resolution != "Fixed"])

    But that would have to be in a control that is bound to your field that has the project in it? It kind of depends where you are using the formula. Feel free to attach your template under the options tab if you'd like me to take a look...

    Hilary Stoupa

  • 01-16-2014 07:19 PM In reply to

    • L Mac
    • Not Ranked
    • Joined on 01-14-2014
    • PNG
    • Posts 16

    Re: Count filtered results in a repeating table

     Thanks Hilary,

    I had made the assumption that absolute was needed as i was working in two data sources, and I had already had the count bound to the field where the value for @Project came from.

    Issue is now resolved. Thanks for your assistance.

     L Mac.

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