2 Replies Latest reply on Oct 26, 2016 8:34 AM by Matt Hong

    Checking if any column contains a 1 for a unique individual

    Matt Hong

      I have 58 rows (corresponding to a unique person) and 7 columns, and I've pivoted the columns.

       

      There are two dimensions to group the people with. Namely, there are 2 possible Table Names and 2 possible Groups, so there are 2*2=4 groups total.

       

      For each group, I need the count of people who have a "1" for a value in any of the 4 pivoted columns (out of 7) I am interested in.

       

      One obvious method would be something like creating 4 calculations corresponding to the values in each of the 4 columns, and finally getting a calculation that is an IF statement with a bunch of ORs:

       

      SUM(IF [Column 1] == '1' OR [Column 2] == '1' OR ...etc... THEN 1)

       

      But there are actually even more columns and I do not want to create a calculation for each of them. I have attached a .twbx. Any help would be appreciated.