Setting a col value with a condition

hello everyone, i need a little help with this expression, let me context my problem, i have a table that register dispatch requests from users, that requests are classified by types ( [Tipo_despacho] ) when the order has been dispatched i use this expresion to change the status of the order

if(
in([_thisrow].[Tipo_despacho], 
  	select(despacho[tipo_despacho],[ID_Benef]=[_THISROW].[ID_Benef]))=true,
"Despachado", "Pendiente")

well that works fine but i have 1 category in [Tipo_despacho], that repeats some times, and when an user creates another request for the same [ID_Benef] the expression result as true and change the status cause there are older request with the same [Tipo_despacho] in it, there is any way to filter the older orders only for that particular type of [Tipo_despacho] ?

in the picture its an example, those two orders where created for today and both have the same type, there is another order from a month ago that have that type too for that [ID_Benef] , so when they were created my expression set them to โ€œDespachadoโ€ instead of โ€œPendienteโ€.

0 2 165
2 REPLIES 2
Top Labels in this Space