Counting letters in a repeating table field. - InfoPath Dev
in

InfoPath Dev

Counting letters in a repeating table field.

Last post 01-31-2012 08:39 AM by Drewski. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-23-2006 07:26 AM

    • ilse
    • Not Ranked
    • Joined on 10-27-2006
    • Posts 18

    Counting letters in a repeating table field.

    I have a repeating table and I want another field to give me the sum of all the letter A#%92s for example are in that field.

    We will only be entering an A, C, H, R or X and I need 5 different fields to count each letter. We used to have this in Excel and the formula in there was =COUNTIF(C8:C115,"a") but countif is not a function in IP. How can I make InfoPath count my letters?

    Thanks.
  • 11-23-2006 11:45 AM In reply to

    Re: Counting letters in a repeating table field.

    Hi Ilse,
    Is the field a single character or a string of characters? If it is a single character, just double click on the field in the designer and add 5 rules - 1 for each letter condition - that check the string (the condition) and then have an actino to set another field to it's existing value + 1. This won't support edits (since it will keep incrementing). For that, you'll need to have an OnBefore and OnAfter change event handlers. There's probably a way to prevent double increments using rules, but I need to go prepare for Thanksgiving holiday ...
    Patrick Halstead
    Project Manager at Qdabra
  • 11-24-2006 02:17 AM In reply to

    • ilse
    • Not Ranked
    • Joined on 10-27-2006
    • Posts 18

    Re: Counting letters in a repeating table field.

    Thanks Patrick,

    That would have been a good idea but the values change. It is a single character but it will change from day to day. Today it might be an A but it could be an H tomorrow. I am still no master of coding. I Google a lot a through trial and error and the occasional fatal error I sometimes accomplish what I was looking for. If you or anyone else can push me in the right direction with coding, again I would be most grateful.

    Kind regards,
    Ilse
  • 11-24-2006 02:35 AM In reply to

    • Stavi
    • Top 100 Contributor
    • Joined on 12-13-2005
    • Posts 95

    Re: Counting letters in a repeating table field.

    count(fieldname[fieldname = "A"])

    To enter this formula double click the text box for the total, click the fx button by default value, click insert function, double click count, double click the insert field, choose your field from the repeating table, click filter data, add a filter to select the same field which equals the letter you want, click ok 4 times, make sure the "update this value when result changes" box is ticked, click ok. Repeat for each letter
  • 11-24-2006 03:13 AM In reply to

    • ilse
    • Not Ranked
    • Joined on 10-27-2006
    • Posts 18

    Re: Counting letters in a repeating table field.

    Stavi !! You are amazing, it works like a charm. Thank you so much!
  • 04-14-2011 10:20 PM In reply to

    Re: Counting letters in a repeating table field.

    Thanks Stavi this helped me too!

  • 06-28-2011 05:49 AM In reply to

    Re: Counting letters in a repeating table field.

     hey stavi,

    it helped me.. thanks specially as you gave the steps.

  • 01-31-2012 08:39 AM In reply to

    Re: Counting letters in a repeating table field.

    Stavi great post!
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.