Counting Totals Problem. - InfoPath Dev
in

InfoPath Dev

Counting Totals Problem.

Last post 03-28-2008 12:29 AM by rohit. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-31-2007 09:48 AM

    Counting Totals Problem.

    Counting Totals Problem.

     

    Hello, InfoPath in new to me but I hope to find a solution to this problem I have with retrieving a total.

     

    I have an expression box that I desire to give a total of the number of “True” in a “ROW”.

     

    This is an example of the Table:

     

    Column1          Column2

    Row1               Q1                   Q2

    Row2               True               False

    Row3               False                False

    Row4               True                 True

      

    If I have this "expression box" with this formula these are my results:

    Count (@ID[@Q1 = “True”])

    Results equal 2 and this is correct

     

    If I change it to:

    Count (@ID[@Q1 = “True” and @Q2 = “True”])

    I will get a result that equals 2.  I need it to equal 3 each .. What I am looking for is to count ALL “True” entries in each row.  I have 7 columns and need to count every “True” in all the rows returned. 

     

    NOTE:  I did change in the second example to an “OR” and it will return the number of  “True” in the first column.  Like it inores the 2nd column.

     

    Thanks for any help you might be able to provide me with.

     

    Richard.

     

  • 12-31-2007 11:42 AM In reply to

    Re: Counting Totals Problem.

    Hey Richard, Welcome!

    How about this Count (@ID[@Q1 = “True”]) + Count (@ID[@Q2 = “True”])

    That should give you the total number of trues in each column combined.

  • 12-31-2007 01:46 PM In reply to

    Re: Counting Totals Problem.

    Greetings Clay .. I must be missing something still?  I tried what you sent but maybe I am not placing it correctly cause it did not work?  Here is what i have that works for counting through the "True" throgh Q1 column:

    count(dfs:dataFields/d:tbl02Survey/@ID[../Q1 = "Ture"])

    Tried several differnt cobos of what you sent to me but can't get any to work .. If you have a another suggestion I'd glady like to know?

     Again, Thanks for any advise you can offer.

     Richard

  • 01-01-2008 01:27 AM In reply to

    Re: Counting Totals Problem.

    If this works count(dfs:dataFields/d:tbl02Survey/@ID[../Q1 = "True"])

    then I assume this works count(dfs:dataFields/d:tbl02Survey/@ID[../Q2 = "True"])

    So then you should be able to add them together count(dfs:dataFields/d:tbl02Survey/@ID[../Q1 = "True"]) + count(dfs:dataFields/d:tbl02Survey/@ID[../Q2 = "True"])

  • 03-26-2008 03:41 AM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: Counting Totals Problem.

    Hi Richard,

     

    I also stuck over here.

    If you get a solution then please post it.

     

    Thanks,

    Rohit.

  • 03-27-2008 08:22 AM In reply to

    Re: Counting Totals Problem.

    Yes i did fix is sorta ... I just started a new form .. not coping data from old form.  I had to RE-Create the whole thing from scrach.  Adding to the form one peice at a time .. then test .. then add another .. and then it all worked.  Slow process and I am still in the mist of it ..

    Cheers,

    Richard

  • 03-28-2008 12:29 AM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: Counting Totals Problem.

    Hi Recchard,

     

    Which code you used among the above mentioned ways.

     

    Thanks in advanced,

    Rohit

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