Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Order status based on date combinations

Hello,   My question is related to showing the Status in a large database of different orders based on: same order number and Received / Shipped combinations?   I have included a sample below. Ba...
  • lbendlin's avatar
    2 years ago

    Note that this is a calculated column, tagging each order line.

     

    Status = 
    var o = [Order#]
    var a = filter(all('Table'),[Order#]=o)
    RETURN switch(TRUE(),
    countrows(a)=sumx(a,if(ISBLANK([Received date]),0,1)) && countrows(a)=sumx(a,if(ISBLANK([Shipped date]),0,1)),"Received and Shipped",
    countrows(a)=sumx(a,if(ISBLANK([Received date]),0,1)),"Only Received",
    sumx(a,if(ISBLANK([Received date]),0,1))>0,"Partially Received",
    "Ordered")