Select to view content in your preferred language

Survey 123 - if(condition, a, b)

351
1
04-24-2023 07:34 AM
EdmundoRodrigues
New Contributor

Oi pessoal!
Estou precisando de ajuda com uma fórmula que envolve condicional que envolvem preenchimentos de datas e status de aprovação. Por algum motivo que não consigo identificar está apresentando erro.

Estou usando a seguinte fórmula:
if(selected(${Data_correcao}<=${Prazo_correcao}) and ($(Status_CR})=Aprovada,'Atendido no prazo', if(selected(${Data_correcao}>${Prazo_correcao}) and (${Status_CR})=Aprovada, 'Atendido fora do prazo’, if(now() >date(decimal-date-time(${Data_envio}) + 5) and string-length(${Prazo_correcao})=0 , 'PAC Pendente', if(now() >date(decimal-date-time(${Prazo_correcao}) and string-length(${Status_CR})=0, 'Em atendimento', if(now() >date(decimal-date-time(${Data_envio})) and string-length(${Status_CR})=Não Aprovada , 'Não atendido'))))))))

Será que alguém conseguiria me ajudar?

0 Kudos
1 Reply
abureaux
MVP Frequent Contributor

I had to use google translate, but I think I get it. I will try to point you in the right direction. Tive que usar o google tradutor, mas acho que entendi. Vou tentar apontar você na direção certa.

A big tip when working with complex nested IF statements in S123 Connect: add the = sign in the cell and it will show you the colorful tags (see below). This can make it easier to troubleshoot.

abureaux_0-1682361079170.png

You have a number of errors. Here is a brief overview:

abureaux_7-1682362015875.png

Try working from this. It's hard for me to know exactly what you are trying to achieve, but this should help move you in the right direction. Good luck! Tente trabalhar a partir disso. É difícil para mim saber exatamente o que você está tentando alcançar, mas isso deve ajudar a movê-lo na direção certa. Boa sorte!

if((${Data_correcao}<=${Prazo_correcao}) and (${Status_CR}='Approved'),'Meet on time', if(${Data_correcao}>${Prazo_correcao} and selected(${Status_CR },'Approved'), 'Attended after the deadline', if(now() > date(decimal-date-time(${Data_envio}) + 5) and string-length(${Prazo_correcao})=0 , 'PAC Pending ', if(now() > date(decimal-date-time(${Prazo_correcao}) and string-length(${Status_CR})=0, 'In attendance', if(now() > date(decimal-date-time(${Date_Send})) and string-length(${Status_CR})=0,'Not Approved', 'Not Fulfilled'))))))

 

0 Kudos