Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Alternating values based on two columns

Hi Everyone,

I want a column to give alternating values. Consider this as an example.
3 columns- ECN_ID, LogDate, LogTime

 

 

The min time entry for each employee each date will be "in" and max time entry will always be "out". Incase the count of rows is even then it should check if the previous entry is "in" then return "out", if "out" return "in". Incase of odd count of rows, it should do the same thing except keep the second last row also "odd". 

I have created a measure to achieve this and it is working fine, just the alternate values part is not working. 

This is the measure that I have used. 

 

1 Reply