Solved
Index record type with condition
How to index department from one of the index where empId is same as loggedin user Id.
here allUsers stores Record data.

How to index department from one of the index where empId is same as loggedin user Id.
here allUsers stores Record data.

you can query the data based on loggedin user details from which you can find logged in user id and then
find the indexes where these id exists , and extract the department from the indexes
take reference from this code
index(local!allUsers[recordType!yourRecord.field.department],wherecontains(local!loggedInUserId,local!allUsers[recordType!yourRecord.field.empid]),{}) Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.