Forum Discussion

char23's avatar
char23
Icon for Helper II rankHelper II
2 years ago
Solved

Compare and lookup date in same table

Hello, I am trying to add a calculated column to list "deleted" for any ID that does not show in the most recent entry (1). What is the best way to approach this? I tried creating with using if state...
  • FreemanZ's avatar
    FreemanZ
    2 years ago

    hi char23 ,

     

    try like:

    Column =
    VAR _entry = [entry]
    VAR _id = [id]
    VAR _entrypre =_entry - 1
    VAR _idlistpre = CALCULATETABLE(VALUES(data[id]), data[entry] = _entrypre, ALL())
    VAR _result = IF( _id in _idlistpre || ISEMPTY(_idlistpre) || _entry>2 , BLANK(), "Deleted")
    RETURN  _result