Forum Discussion
KayceVC
7 years agoHelper II
Find Value in Same Table
I have an audit table which contains audit log data. I am trying to isolate when a particular event happens, if another event happens on the same day for the same user. In this example,...
- 7 years ago
Hello KayceVC
Give this a try. I had a check for the time on the 42 being after the time on the row but it doesn't read like you need that but I left it in the code and just commented it out.
Result = VAR TheDate = DATEVALUE ( auditdata[Date_Updated] ) VAR TheDateTime = auditdata[Date_Updated] VAR TheUser = auditdata[User] VAR NumRows = 0 RETURN IF ( auditdata[Key_ID] = 22, CALCULATE ( MAX ( auditdata[Date_Updated] ), FILTER ( auditdata, auditdata[User] = TheUser && auditdata[Key_ID] = 41 && DATEVALUE ( auditdata[Date_Updated] ) = TheDate --&& auditdata[Date_Updated] > TheDateTime ) ) )
PattemManohar
7 years agoCommunity Champion
KayceVC Could you please post the sample data that can be copied instead of screenshot. Also, what is your expected output... Please post the expected output as well.
Is it just to list ParentIDs and Flag (if there is a Key_ID 22 and followed by 41 for same user on same day)