Fórmula para filtrar dados entre data inicial, data final e funcionário

Olá pessoal, sou novo no appsheet e no momento não estou conseguindo filtrar dados entre dois dados com uma terceira condição que seria por funcionario. Precisando de uma fórmula para gerar relatório de funcionamento entre dois dados (data inicial e data final)

Olá pessoal, sou novo no appsheet e no momento não estou conseguindo filtrar dados entre duas datas com uma terceira condição que seria por funcionário. Precisando de uma fórmula para gerar um relatório de funcionário entre duas datas (data inicial e data final)

Captura de tela 2023-05-29 000221.png

Solved Solved
0 9 1,368
2 ACCEPTED SOLUTIONS

1. Please update on which table you want to run the filter. Does the table have [Date] and [Employee] columnss?

2 Please update if the RELATORIODINAMICO is a slice or table and is it  the same table in point 1 or slice  on the table mentioned in point 1?

In general expression can be something like

AND(
[DATA]>= ANY(RELATORIODINAMICO[DATA_INICIAL]),
[DATA]<= ANY(RELATORIODINAMICO[DATA_FINAL]),

[Servidor] = ANY(RELATORIODINAMICO[Servidor])

)

You will need an enum  dropdown in RELATORIODINAMICO table or slice to list all the Servidors  so that the user can select any one of them.

View solution in original post


@Suvrutt_Gurjar  wrote:

Thank you. Are REPORT and FILTERED REPORT views on the same table?


Please respond on the above request.


@Edmundo  wrote:

I thought about that, but every time a new server enters, I will have to edit the table (enum), being hostage to sporadic editing.


You could use valid_if constraint to always get the latest list of servers. You could get that list by using the expression Servers Table[Server Name] or Servers Table[Server ID] in the valid_if constraint for example.

Drop-down from Valid_If - AppSheet Help

 

 

 

 

View solution in original post

9 REPLIES 9

Please take a look at the sample app below. You could build a slice filter expression based on start date , end date and employee.

You may need another table for all app users with one row for each user, if you are expecting the app to be used by multiple users and they all can use the filter.. This each user's row will store the filter selection for  that user. As you can imagine user A and User B may have different filters selection ( start , end dates and employee name) and each user's selection needs to be stored.

The sample app is for just one user and one filter parameter but you can modify the concept for multiple users and multiple parameters based on the Users table.  The sample apps are available at Get started by using the feature samples - AppSheet Help

Sample app: 

Slice based on user input - AppSheet

 

These articles may also be useful

Slices: The Essentials - AppSheet Help

Slice row filter conditions - AppSheet Help

Also please do understand the difference between slice filters and security filters.

Security filters: The Essentials - AppSheet Help

Limit users to their own data - AppSheet Help

 

 

 

 

 

Olá Suvrutt, olhei o modelo que você me encaminhou, mas infelizmente não entendi, até o momento, como extrair uma ideia para aplicar no meu problema.

Procurei nas colunas da tabela dados e Filtro, mas nenhuma delas contém formula para um entendimento.

Estava procurando algo assim:

AND(
[DATA]>= ANY(RELATORIODINAMICO[DATA_INICIAL]),
[DATA]<= ANY(RELATORIODINAMICO[DATA_FINAL])
)

Na formula acima conseguir fazer o filtro de dados entre as datas iniciais e finais, mas está faltando a parte que interliga o funcionario, ou algo que faça um filtro com essas 3 condiçoes. Ou seja, queria que me retornasse os dados de um determinado funcionário entre as datas Inicial e data final.

1. Please update on which table you want to run the filter. Does the table have [Date] and [Employee] columnss?

2 Please update if the RELATORIODINAMICO is a slice or table and is it  the same table in point 1 or slice  on the table mentioned in point 1?

In general expression can be something like

AND(
[DATA]>= ANY(RELATORIODINAMICO[DATA_INICIAL]),
[DATA]<= ANY(RELATORIODINAMICO[DATA_FINAL]),

[Servidor] = ANY(RELATORIODINAMICO[Servidor])

)

You will need an enum  dropdown in RELATORIODINAMICO table or slice to list all the Servidors  so that the user can select any one of them.

1. Atualize em qual tabela deseja executar o filtro. A tabela tem as colunas [Data] e [Empregado]?

Tenho uma tabela fatia (RELATORIOFILTRADO), ela contém as colunas data e servidor (empregado)

fatia relatoriofiltrado.png

2 Atualize se o  RELATORIODINAMICO é uma fatia ou mesa e é a mesma mesa do ponto 1 ou fatia da mesa mencionada no ponto 1?

RELATORIODINAMICO e uma dashboard (não é fatia).

relatorio dinamico.png

Pela formula que eu mencionei no post anterior eu consigo fazero filtro por data inicial e data final, mas não consigo filtrar por empregado(servidor).

relatorio filtrado.png

 

Thank you. Are RELATORIO and RELATORIO FILTRADO views on the same table?

Mandando imagem, para berve analiserelatórios .png:

 

Será necessário um dropdown enum na tabela ou slice RELATORIODINAMICO para listar todos os Servidores para que o usuário possa selecionar qualquer um deles.

Pensei nisso, mas toda vez que entrar um servidor novo, deverei editar a tabela (enum), ficando refem de edição esporadica.

AND(
[DATA]>= ANY(RELATORIODINAMICO[DATA_INICIAL]),
[DATA]<= ANY(RELATORIODINAMICO[DATA_FINAL])
[SERVIDOR] = ANY(RELATORIODINAMICO[SERVIDOR])
)

tentei pela formula com a adição que você enviou, mas não deu, acredito que os dados devem vim da fatia (RELATORIOFILTRADO) que vêm da mesa DADOS.

Vou analisar as referencias que você me enviou e procurar entender a solução viável.


@Suvrutt_Gurjar  wrote:

Thank you. Are REPORT and FILTERED REPORT views on the same table?


Please respond on the above request.


@Edmundo  wrote:

I thought about that, but every time a new server enters, I will have to edit the table (enum), being hostage to sporadic editing.


You could use valid_if constraint to always get the latest list of servers. You could get that list by using the expression Servers Table[Server Name] or Servers Table[Server ID] in the valid_if constraint for example.

Drop-down from Valid_If - AppSheet Help

 

 

 

 

Obrigado. As visualizações RELATÓRIO e RELATÓRIO FILTRADO estão na mesma tabela?

Suvrutt, eu não sei responder, pois só tenho 3 semanas de appsheet, mas vou postar aqui uma imagem para um breve entendimento, para quem sabe você saberá a resposta pela imagem?:

relatórios .png

Top Labels in this Space