I have the below data (from a table) with fields TransactionDate, UserID, and the StatusDesc. The goal is I want to show the userID, where the UserID does not have a login failure (indicated by statusDesc Column - 'Rejected') occurring prior on the same day as a successful login ( Sucessfull Login is indicated by statusDesc Column - 'Success').
Actual DATA
TransactionDate UserId StatusDesc
2018-12-02 00:00:01.957 [email protected] Rejected
2018-12-02 00:00:14.907 [email protected] Success
2018-13-02 00:00:22.390 [email protected] Success
2018-13-02 00:00:28.610 [email protected] Rejected
2018-14-02 00:00:22.390 [email protected] Success
2018-14-02 00:00:28.610 [email protected] Rejected
Expected Result
TransactionDate UserId StatusDesc
2018-13-02 00:00:22.390 [email protected] Success
2018-14-02 00:00:22.390 [email protected] Success
You can use an LOD (Level of Detail) expression in a Calculated Field for this. LOD's can be tricky to wrap your head around at first, but once you've used them a few times they become very handy.
{ FIXED [UserId], DATE([TransactionDate]) : MIN(
IF [StatusDesc] = "Rejected" THEN
[TransactionDate]
END
)
}
ISNULL([First Rejection of Day]) = FALSE AND [First Rejection of Day] <= [TransactionDate]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments