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

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.

• ###### 1. Re: Checking if any column contains a 1 for a unique individual

Hello Matt,

Not sure if I've understood your requirements well.

Partly based on my guess, I created a sample for your reference.

The result,

Please refer to the attached workbook for the details.

Regards

• ###### 2. Re: Checking if any column contains a 1 for a unique individual

Hey turns out that's exactly what I was doing! It was something else that was the problem... but it's good you've confirmed my method!