Discussions

Expand all | Collapse all

Take total of a field and use it for percentage

  • 1.  Take total of a field and use it for percentage

    Posted 09-13-2017 07:39
    Hi,

    I have a table which consists of questions whose answers are only Yes/No/NA. I would like to see total number of Yes,No and NA for all questions. I can sum them for only one row, but I want to do that for all table. After that, I want to take percentage of them without NA i.e.

     (total yes) / (total yes+ total no) and
     (total no) / (total yes+ total no) 

    Then, I would like to have their graph as total yes-total no-total NA and percentage yes and no. 

    How can I do this?

    Thanks


  • 2.  RE: Take total of a field and use it for percentage

    Posted 09-14-2017 02:21
    Ideally all of these questions and answers would be child records (which provides much better reporting capabilities), but seeing as you just have the fields...

    You will want to make 3 formula fields; # of Yes, # of No, # of N/A.

    If the formula you use will be something to the affect of:
    Sum(
    If([Question 1]="Yes", 1, 0),
    If([Question 2]="Yes", 1, 0),
    If([Question 3]="Yes", 1, 0)
    )

    Repeat for all questions, then you can copy it and change the "Yes" to "No" and "N/A".

    Now you will have numeric values that you can graph or count for your averages and totals.


  • 3.  RE: Take total of a field and use it for percentage

    Posted 09-14-2017 04:12
    Thank you. I have already this formula, but this works for only one entry. What I want is sum all "Yes" answers from all entries in other words reaching total as can be found below.



    Is there a way to reach these values? 


  • 4.  RE: Take total of a field and use it for percentage

    Posted 09-14-2017 13:05
    Try this

    Make a new formula numeric percentage field called [Yes %]

    var number Yes = Count(
    [Q1] = "Yes",
    [Q2] = "Yes",
    [Q3] = "Yes",
    [Q4] = "Yes",
    [Q5] = "Yes");

    Do the same for the NOs.

    Then

    $Yes / ($Yes + $No)

    Then set that field to show averages and not totals