(plz help) Prevent duplicated items in same load

Hello,
I’m stuck with a problem
we have an application where we load the monthly stock of the
restaurant, the goal is to disable the items that were loaded into the stock of THIS load, that is, I want it to be blocked to add twice to the inline.

For example,
last month all the monthly stock was made, but the same item was added by mistake three times.

I would like to disable the ability to add the same item more than once but only to THIS upload, not forever.

I used the following formula:

NOT(IN([_THIS], SELECT(DETALLE INVENTARIO[ARTICULO], [ARTICULO] = [_ThisRow].[ARTICULO])))

and it works but if you loaded it once in another load, save, and choose it again, it is now disabled forever and I would like that not to happen.

Thanks for the help in advance!

Solved Solved
0 11 407
1 ACCEPTED SOLUTION

The same principal applies as what @Lynn suggested. You need some way to identify which upload process added the record.

The assumption here is that when you upload the inventory info, a new record is added each time an item is uploaded for THIS upload process. In other words, you have a set of rows added each time you perform the upload.

If so and you truly do have a column named Upload ID, then simply add the Upload ID as a column on the newly added rows and then adjust your expression as follows:

NOT(IN([_THIS], SELECT(DETALLE INVENTARIO[ARTICULO], 
          AND([ARTICULO] = [_ThisRow].[ARTICULO],
              [Upload ID] = [_THISROW].[Upload ID]))))

View solution in original post

11 REPLIES 11
Top Labels in this Space