Slice Filter - First in, First Out

Dear all,

I’ve been working on an app which controls an food industry stock.
It is extremely important for me to only allow user order the dispatch cargo by its fabrication date. Therefore, I’m building a slice which selects every time the form is open, the first [GTIN] columns which has a stock > 0.
AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”. [GTIN] <>“2222222222222” ))),(NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))) )

Those products are being pulled from a slice called “produtos que não estão na saída”, in the column “ID da Caixa”. I’m also trying that the products which are already in the “Produtos que não estão na saída” do not appear when filling the list of products being dispatched in this cargo.

In advance, thank you all for the support.

Regards;

Fábio

Solved Solved
0 11 334
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Your expression:

AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”. [GTIN] <>“2222222222222” ))),(NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))) )

Try instead:

AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”. [GTIN] <>“2222222222222” ))),(NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))), ([GTIN]= [_THISROW].[GTIN]) )

View solution in original post

11 REPLIES 11

Hello @Fabio_Nabuco_Correia, i have read your post but couldn’t find your question, what’s the problem?

Hey Rafael,

In advance, thank you for your quick support.

This filter do not work as I’m expecting:

It does not filter the ‘oldest’ row of [gtin] which has a [saldo] column > 0, not contained in the slice Produtos Que não estão na saída and which has a [gtin] <> than “1111111111111” AND “2222222222222”.

It seems to filter only the first time I open the form parent to this child slice.

I suspect you aren’t actually using a slice.

Hey Steve,

Actually, I’m trying to use two slices, as if I was building a “shopping cart”:

-One slice which “holds” the itens which are selected in the below slice;
3X_a_4_a4d3b6745d7284513fc739c665f7520e541a19f1.png
with filter: IN([_thisrow].[ID Pedido],Saída com Rastreabilidade[Número do Pedido])

-one slice which selects only the ‘oldest’ [gtin] columns( or the first created ) >0 stock level, and which are not added in the above mentioned slice.
3X_d_f_df07d10ee52fe0a69ef9c7937247c351906450e4.png

With filter: ([GTIN] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[gtin], AND(([saldo]>0), [GTIN] <>“1111111111111”, [GTIN] <>“2222222222222” ))))

It seems that the above filter is almost working as intended, but instead of showing the ‘oldest’ stock of each [gtin] higher than zero, it is showing all records equals to the last [gtin] with stock >0 .

Thank you for your support.

Regards;

Fábio

Steve
Platinum 4
Platinum 4

There is a period (.) there where a comma (,) should be.

I’m sorry, right after I send it , I realized it had a period (.). But even after correting it, it did not worked as I expected

( min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[gtin], AND(([saldo]>0), [GTIN] <>“1111111111111”, [GTIN] <>“2222222222222” ))))

perhaps, this would work, but it says that :

The expression is valid but its result type ‘Number’ is not one of the expected types: Yes/No

Steve
Platinum 4
Platinum 4

Your expression:

AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”. [GTIN] <>“2222222222222” ))),(NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))) )

Try instead:

AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”. [GTIN] <>“2222222222222” ))),(NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))), ([GTIN]= [_THISROW].[GTIN]) )

Steve, It works with near perfection:

When I add the ‘older’ product, the next time I open the form I would like that the product with the second ‘older’ [Data] appeared instead of the first older, and so on…

For example:

If I had a product with
[gtin] = 111 and [data de produção] = 01/11 and other with
[gtin]=111 and [data de produção] 02/11,

The first time I opened the form and added the product, it was the one with [data de produção] = 01/11,

The second product I would add, would be the one with same [gtin] and [data de produção] = 02/11.

I’d like that the filter selected the older NOT IN THE LIST. Maybe AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”. [GTIN] <>“2222222222222” ))),(NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))), ([GTIN]= [_THISROW].[GTIN]) ) the not in condition could go together with the condition that [saldo] > 0 .
Perhaps I’m not being extremely precise with my definition of the problem. let me know if I’m understandable.

Regards;

Steve,

AND([DATA DE PRODUÇÃO] = min( SELECT( RELAÇÃO DE TODOS OS PRODUTOS[DATA DE PRODUÇÃO], AND(([GTIN]= [_THISROW].[GTIN]), [SALDO] > 0, [GTIN] <>“1111111111111”, [GTIN] <>“2222222222222”, (NOT(IN([Label], Produtos Que não estão na saída[ID da caixa]))) ))), ([GTIN]= [_THISROW].[GTIN]) )

You’re nothing less than a genius!!

Correction: it works, but there’s something not right in the selection:
I have a ‘audition’ slice, which is not tied to anything else, it just filters the products with [saldo] >0 with [GTIN] <> from the above mentioned. It shows a few products, which possibily means that the [produtos que não estão na saída] slice is filtering products I would like to be in the list.

I just created a view to this slice and it is showing products of the past. I would need to create a filter to hold only the ones inside the form of dispatch( the grandparent table ) .

Thank you very much, Steve!!

I’m afraid I’m getting confused. What is the Produtos Que não estão na saída table for?

Hey Steve, I’m sorry the absence.

This slice holds the products in the list which have not been dispatched yet.

3X_8_c_8c6790bcde0dc21e277305be4e9d75062b42324f.png

nOT(IN([id pedido],SAÍDA COM RASTREABILIDADE[Número do Pedido]))

When user fills the form with child records, it hold the child records differentiating the ones in the form with all other records of child table.

I’m not sure if thats the ‘right’ way to do so.

By the way, this was a solution to one problem, but it created other:

I needed to differentiate the child records being filled to the previous ones, but when the form is finished, I need to keep the track of the ones related to the parent record.

When I try to check the parent record, it does not show the child records, nor the PDF BOT generation keep track of the child records:

Thank you for your support!!

Top Labels in this Space