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

已提問 3 年前檢視次數 317 次
1 個回答
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

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南