1

Goal: I want to create a pivot table with the QUERY function while using I have multiple criteria (using ANDs and ORs at the same time). The table basically consists of 2 columns: Col C is "Employee," Col B is "Status." The values for Status contains: "In Progress" "Consultation" "Require Information" and "Technical Issue." And there are multiple employee names that I won't bother listing. And I wanted it to basically count the number of statuses each employees have.

Now, I actually had a functional formula that was working well, however I wanted to add another criteria, which was to exclude (filter) one particular employee (let's say this person's name is "John A") from the result. And I want to be able to keep the criteria that I currently have and just add the new one. The formula before the modification is below.

Formula before modification:

=QUERY('Blend Data'!$A$3:$C,"select C, COUNT(C) where (B = 'In Progress' OR B = 'Consultation' OR B = 'Require Information' OR B = 'Technical Issue') GROUP BY C pivot B",0)

Issue: However I when I made changes to the formula, the result didn't change and didn't get any errors.

Formula after modification:

=QUERY('Blend Data'!$A$3:$C,"select C, COUNT(C) where (B = 'In Progress' OR B = 'Consultation' OR B = 'Require Information' OR B = 'Technical Issue' AND C = 'John A') GROUP BY C pivot B",0)

1 Answer 1

1

try:

=QUERY('Blend Data'!A3:C,
 "select C,count(C) 
  where B matches 'In Progress|Consultation|Require Information|Technical Issue' 
    and C = 'John A' 
  group by C 
  pivot B", 0)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.