Count function issue - InfoPath Dev
in

InfoPath Dev

Count function issue

Last post 08-25-2010 06:27 AM by Marouquin26. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 08-25-2010 02:35 AM

    Count function issue

    Hi,

    Here is the problem I have tried to solve for the past two days. I have a repeating table (see below) which contains another repeating table of three fields Peer review comments, Peer review and Bug sev. After this repeating section, I have a normal table in which I would like to add up the number of entries:

    For example, if the user select PR1 in Peer Review and Sev1 in Bug sev, it will put 1 in the corresponding cell in the table beneath.

    So far I have been able to count but only for one field and I don't know if it is possible to use the count function on two fields at the same time (I doubt it). My formula is count(bug_sev[. = "Sev1"]) and I could stick to this adapting it for each cell but I would not get the calculations I need.

    File name and section
    Drafting changes made
    Peer review comments
    Peer review
    Bug sev
    Select...PR1PR2PR3 Select...Sev1Sev2Sev3Sev4GrammarPMCancelled
     
    PM
    Comment
    Grammar
    Sev1
    Sev2
    Sev3
    Sev4
    PR1
     
     
    PR2
     
     
     
     
     
     
    PR3
     
    PLEASE HELP!!!
     
    Benjamin
     
     
     
     
     
     
     
  • 08-25-2010 04:17 AM In reply to

    I'm not really clear on what you're trying to accomplish.  Could you give us a few more details?  Possibly a screenshot of what you'd like it to do and what your repeating table looks like?  You posted a table with some text, but it seems to have some formatting problems, and there aren't any numbers there.  What do you mean by "use the count function on two fields at the same time"?  I don't see what connection that has to your second paragraph.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-25-2010 05:00 AM In reply to

    Hello,

    My post wasn't very clear indeed but the happy part is that I have found a workaround in the meantime. As I cannot attach a screenshot I will explain it:

    In my repeating table I have two drop-down list fields (Peer Review and Bug Sev) which have several entries each

    In my normal table beneath, I wanted to implement formulas that will calculate (add up) the number of times each pair appears. For example, if the user chooses PR1 and Sev1 I would see 1 in the corresponding cell in my table and it would add up each time he enters the same input. What I meant by "using the count function on two fields" was to know if it was possible to insert more than one field in the count formula. Let's say that I wanted that it counts the number of instances based on two fields.

    The solution I came up with is to create a third field in my repeating table with a formula that concatenates the two entries in Peer Review and Bug Sev. Then I delete it from the template but it stays as an hidden field. After that I just had to create count formulas in each cell of my table based on the text I had in the concatenated field.

    I don't know if this is clearer this time...

    If there is another solution, please let me know.

    Ben

  • 08-25-2010 05:59 AM In reply to

    Ok, I think I understand a bit better now.

    It sounds like you should be able to accomplish this with an and operator:

     count(bug[bug_sev = 'Sev1' and bug_pri = 'Pri1'])

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-25-2010 06:27 AM In reply to

    Thanks this is exactly what I wanted to do. I had tried before with an and operator but I must have had input it wrongly.

     Your help was much appreciated

    Ben

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