Forum Discussion

rajasekar_o's avatar
rajasekar_o
Icon for Helper V rankHelper V
2 years ago
Solved

Attendance out time

  hi team i have daily attendance sheet , if type 0 is intime 1 is outtime i need min of out time and the aboue data   21.11.23 have intime but no outtime the the employee out from office ne...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi rajasekar_o,

    You can try to use the following calculated table formula to create a new table with the current table records based on empname, Date group and correspond in/out time values.

    newTable =
    SUMMARIZE (
        ADDCOLUMNS ( Table1, "Date", DATEVALUE ( [Datetime] ) ),
        [empName],
        [Date],
        "In Time",
            CALCULATE (
                TIMEVALUE ( MIN ( Table1[Datetime] ) ),
                FILTER (
                    ALLSELECTED ( Table1 ),
                    DATEVALUE ( [Datetime] ) = [Date]
                        && [Type] = 0
                ),
                VALUES ( Table1[empName] )
            ),
        "Out Time",
            CALCULATE (
                TIMEVALUE ( MAX ( Table1[Datetime] ) ),
                FILTER (
                    ALLSELECTED ( Table1 ),
                    DATEVALUE ( [Datetime] ) = [Date]
                        && [Type] = 1
                ),
                VALUES ( Table1[empName] )
            )
    )

    Regards,

    Xiaoxin Sheng