Expression Builder in Query to COUNT Y/N checkbox (1 Viewer)

LoriR16

New member
Local time
Today, 12:24
Joined
Jan 26, 2023
Messages
4
I have a fairly simple working query where it is picking up review dates by open claims, there is a field called DONE. I need to have a count of the "DONE" check box (results are Y or N) and I can't figure out the expression builder for this

Basically, need to count per claim # how many Y and how many N so I can focus on those without any N
I don't want to know how many Review Done is completely blank/null because this data is from a sql database that the field is part of a 3 field task and sometimes the record keeping is not consistent.

Sample of how I would like to see the output:
Claim 123 Review Done Y is 5 and Review Done N is 2
Claim 456 Review Done Y is 2 and Review Done N is 0
Claim 789 Review Done Y is 0 and Review Done N is 1

Is there a simple way to complete this? TIA. I'm really rusty !!
 

Ranman256

Well-known member
Local time
Today, 12:24
Joined
Apr 9, 2015
Messages
4,337
Q1 : select iif([field]='Y',1,0) as YesFld, iif([field]='N',1,0) as NoFld from table

Q2, count the results from Q1
 

CJ_London

Super Moderator
Staff member
Local time
Today, 17:24
Joined
Feb 19, 2013
Messages
16,618
if you are using a checkbox the values are -1 and 0 for Y and N respectively

so you could use

done: -sum([Done])
notdone: -sum(not [Done])
 

Users who are viewing this thread

Top Bottom