Remove from the drop-down list if it has already been used within 24 hours

I am using this expression NOT (IN ([_ THIS], SELECT (Yard [N FLIGHT], [DATE] = TODAY ()))) to avoid duplication, but I would like it better to be removed from the drop down list when an element has already been used in 24 hours is it possible to do this function?

Patio ([N FLIGHT]) โ†’ where the flights are registered and Program vlos ([Concat vlos]) โ€”> referenced column for the drop-down list

I appreciate your help, I spent hours and hours and I can not make it work :pensive:

Hi @wsaico

Can you share your table structure ? Screenshot are best.

Did you use this:
NOT (IN ([_ THIS], SELECT (Yard [N FLIGHT], [DATE] = TODAY ())))
in the valid_If field ?

You may prefer using a FILTER expression instead.

For example:

FILTER("yourTable",
 AND(
   NOW()-[TimeStamp]<1,
   otherConditions
  )
)

I assume the dropdown column is of type EnumList or Enum, base type Ref.
If not, please change it.

3 Likes

@Aurelien Thanks for your answer, if the expression I am using in VALID IF

Here I put the screenshots.
This is the table (ADUANAS)

and for the drop-down list it is referenced to the table (PROGRAM VLOS) column [Concat vlos]

and VALID IF I have this expression โ€ฆ to avoid double registration during the day

Currently this expression works wonderfully, but users suggested that the item that was already used within 24 hours should be removed from the drop-down list

1 Like

Hi @wsaico,

Thank you for further informations.
Again, please pick Enum instead of Ref, and set base type as Ref with source table PROGRAM VLOS.
That will work better and be easier to manage.

Based on the informations you shared, I suggest you create a slice for the PROGRAM VLOS used today.
Then, use your Valid_If based on that slice.

My suggestion:

Letโ€™s assume [keyVuelo] is the key column of your table PROGRAM VLOS.

Letโ€™s name the slice: โ€œVlosToday_Sliceโ€.
Source table : PROGRAM VLOS
Row filter condition:

IN([keyVuelo],
  SELECT(
    ADUANAS[N VUELO],
    [FECHA]=TODAY()
  )
)

Then, in the [N VUELO] column of the table ADUANAS, the Valid_If expression may be:

PROGRAM VLOS[keyVuelos]- VlosToday_Slice[keyVuelos]

Let us know if that works for you !

2 Likes