I have this alasql query I need to count a total, then if the row has a bool that is true, to count those ones. However, for whatever reason it just counts all the rows including the ones that are false.
var groupedShipDatesAndCabinetCounts = alasql("SELECT ShipDate, SUM(CabinetCount) AS TotalCabinetCount, SUM(CASE WHEN ShipDateConfirmed IS 1 THEN CabinetCount ELSE 0 END) AS LessCabinetCount FROM ? GROUP BY ShipDate", [shipData.TotalShipDatesAndCabinetCounts]);
What do I need to do to get this query working properly? I double check the data and it is all getting to this point as expected.
Thanks in advance