Need a work around for using IF with multiple conditions

I have created an attendance details table that captures the attendance for an employee checking in and checking out every day. I need to display the sum total of today’s employees count on a screen that helps the operations manager manage stuff.

In order to get this number, I have created an IF Else type of field that checks if Check In Time is within today and then outputs 1 else it outputs 0. I then aggregate this column into another field and display the same.

The issue is that the number continues to display the total count, even after the employees check out. Hence this calls for checking

`If (Check-in time is within today AND check-out time is empty) show 1 else show 0. This sum would represent the total truth. I am unable to use multiple conditions in IF as per the current design.

I can brute force this by creating two columns separately checking the two conditions and then creating a third column that resolves based on the first two. But my application is already slow and I DO NOT want to load it further by adding multiple columns. Also, this is a generic use-case that might be used in various scenarios.

Can someone help?

Try this:

  • If Check Out Time is not empty, then 0
  • If Check In Time is within today, then 1

(personally, I’d return null on the first condition and true on the second, and then count the true values. But that’s just personal preference).

Thanks a ton, Darren. This not only helped me in this case, but I think I finally got the concept.

For every failing condition for the previous if, we can configure another if and the bottom else is the final criteria if we fail all if that have been coded above.

:chocolate_bar: Thank you

yep, that’s it. You just need to reverse your logic. Once you get the hang of it, you’ll find that you can create some quite complex matching conditions with just a single if-then-else column.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.