Forum Discussion

MFB's avatar
MFB
Regular Visitor
4 years ago
Solved

Retrieving value in same column with criterias

Hi, I would like to retrieve value from the same column with different criteria, below an example: The new price has to be: the actual price of document type [F] if the document date of doc...
  • amitchandak's avatar
    4 years ago

    MFB ,


    new column =
    var _1 = if([Document Type] = "D", maxx(filter(Table, [User] =earlier([User]) && [Document Date] < earlier([Document date]) && [Document Type] = "F"),[Document date]),Blank())
    return
    if([Document Type] = "D" && not(isbalank(_1)) , maxx(filter(Table, [User] =earlier([User]) && [Document Date] =_1 && [Document Type] = "F"),[New Price]),[New Price])