Correct Syntax for multiple if Match statement -Report level

Beginner here, so please bear with me, ive searched and searched

I have multiple variables for a field that im trying to link to 3 separate catagories using wildcards

Im able to do it for one:

=If Match([Id];“RCP*”) Then “Location1”

I need the correct syntax for multiple ids AND multiple locations

Thank you in advance


scotty24 (BOB member since 2009-01-28)

Try this.

=If(Match([Id];"RCP*";"Location1";If(Match([Id];"AAA*";"Location2";"Location3"))

P.S: Welcome to B :mrgreen: B!

And replace AAA* by your own condition.


Jansi :india: (BOB member since 2008-05-12)

Thank you!

That worked, now i just need add an “or” to location1 for example

RPC* or ABC* would would then “location1”


scotty24 (BOB member since 2009-01-28)

Hi Scotty,
You can use this


=If(Match([Id]="RCP*" OR Match([Id]="ABC*" ;"Location1";If(Match([Id];"AAA*";"Location2";"Location3"))

[/code]


GNK_BO (BOB member since 2007-07-17)

Thank you!


scotty24 (BOB member since 2009-01-28)

Hey scotty,
Was that what you were trying to do?


GNK_BO (BOB member since 2007-07-17)

It is but im getting errors on the syntax.

This works:

=If(Match([Id];“RCP*”);“loc1”;If(Match([Id];“WHP*”);“loc2”;If(Match([Id];“MHT*”);“loc3”; “NA”)))

However when i try to incorporate the OR, i get syntax errors that leave me in a world of confusion


scotty24 (BOB member since 2009-01-28)

Hey Scotty,
Here is the result for which I tested what you were trying to obtain.

Table has 3 columns Empno,Empname,Name Match.

If Empname starts with A or J it should display Name starts with A/J
If Empname starts with S or T it should display Name starts with S/T
If Empname starts with other than this A,J,S,T it should display Others

So created the variable


Name Match=If(Match([Ename];"A*") Or Match([Ename];"J*");"Name starts with A/J";If(Match([Ename];"S*") Or Match([Ename];"T*");"Name starts with S/T";"Others"))

Attached screen shot shows the results.
Hope this helps.
Correct Syntax for multiple if Match statement -Report l.doc (26.0 KB)


GNK_BO (BOB member since 2007-07-17)

Worked great, thank you so much!


scotty24 (BOB member since 2009-01-28)