Hi Quy, set analysis is applied before the rows are calculated, so you can't apply it in row-row basis, the expression will be expanded as:
And this expressio is applied to all rows.
I don't know if employees has many different WorkInDate dates in real data -but it looks like it will be-, in that case maybe you need intervalmatch to set a flag in a table that tells in which TradeDate the employee was active or not (a binary flag), and use this field in set analysis.
If there is only one working date per employee you can create the flag in script foings joins and the comparison between dates to set the flag to use in set analysis:
Join Broker with Link table to have both dates in the same table and create a field in Link table like:
If(TradeDate>=WorkInDate, 1, 0) as isWorkedIndexKey
Expression can be: