Hi everyone.
We're hoping someone may be able to advise of the correct syntax when using Contains in Electronic Reporting to find a range of values.
We are facing a challenge trying to get a Payment model report to return a different value based on the first character of a field, where that field may be any single digit.
The below syntax works:
IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/1/),/true/,/false/)
-- If we Test using a value of 12345 we get /true/
-- If we Test using a value of 34567 we get /false/
What we need to do however is check if the first character of the field is any number 0-9, rather than specifically the number 1. We have tried several approaches including:
a) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/[0-9]/),true,false)
b) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/0-9/),true,false)
c) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/%0-9%/),true,false)
) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/{0-9}/),true,false)
None of a to d work. They all return /false/ when testing, or a syntax error, no matter what number we put into the Test. I have checked the Learn documentation for Contains, but it's quite basic and haven't been able to find a more thorough ER syntax glossary.
Is someone able to confirm the correct syntax for the /[0-9]/ section of the query please?