I have a table imported from airtable that includes deviceID, device type, client, inBacklog (boolean).
I want to make a table that counts the number of deviceID, where the client is not (for example) “retired” or “inhouse”, grouped by device type. Then a second column that counts just deviceID that are in backlog.
example:
pulled from airtable:
deviceID, device type, client, inBacklog:
Device1, typeA, retired, no
Device2, typeA, client1, no
Device3, typeA, client2, yes
Device4, typeB, client3, no
Device5, typeB, in house, no
Device6, typeC, client4, no
Device7, typeC, client4, no
Device8, typeC, client5, yes
Select count(*),
where client != “retired” and client != “in house”
group by “device type”
Also:
select count(*)
where inBacklog = yes
group by “device type”
I’m Looking for a table that looks like (explanations in parenthesis not to be included):
Device type, total in field, total in backlog
typeA, 2 (device2+device3, but not device1), 1 (device3)
typeB, 4 (device4, but not device5), 0 (no devices in backlog)
typeC, 3 (device6+device7+device8), 1 (device8)
I am obviously coming from a SQL background which I think maybe tripping me up. Thank you for any help you can provide.