using locate as a value inside if else

0

Hello, I'm trying to do this:

ifelse(locate({Billing Value},"token") DIFFERENT(i cannot put it on the post I dont know why) 0,
locate({Billing Value},"token"),
"blop"
)
but I get an error, which seems to be related to the fact of using locate as a field, but I don't understand what is going wrong.
Basically what I try to do is locate the word "token" in a field, and if it is found, I want to return its position in the string

Thanks a lot,
Tomy

Edited by: tblondeau on Oct 12, 2021 3:59 AM

Edited by: tblondeau on Oct 12, 2021 3:59 AM

preguntada hace 3 años320 visualizaciones
1 Respuesta
0

ifelse(locate({Billing Value},"token") <> 0,
toString(locate({Billing Value},"token")),
"blop"
)
this fixes it, int needs to be parsed as string for this to work

respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas