5 Replies Latest reply: Jan 30, 2018 8:28 AM by Bram Knuever

# Mid function

Hi all,

In a set analysis want to consider all ProdMktOrc whose 2nd position equals A, 1, 6 or 7. In order to do it, I've written the expression bellow in my set expression:

ProdmktOrc={"\$(=if(Mid(ProdmktOrc,2,1)='A' or Mid(ProdmktOrc,2,1)='1' or Mid(ProdmktOrc,2,1)='6'or Mid(ProdmktOrc,2,1)='7', ProdmktOrc))"}

The expression is not working... Can you help find why?

Thank you!

Sofia Vaz

• ###### Re: Mid function

ProdmktOrc  = {"?A*", "?1*", "?6*", "?7*"}

• ###### Re: Mid function

Thank You Sunny, it's working!

• ###### Re: Mid function

What about something like this: Match(Mid(ProdmktOrc,2,1),'A','1','6','7')

• ###### Re: Mid function

i guess you can't do that with set analysis but instead using if statement OR working in the script as well.

ex. count( if( Mid(ProdmktOrc,2,1)='A' or Mid(ProdmktOrc,2,1)='1' or Mid(ProdmktOrc,2,1)='6'or Mid(ProdmktOrc,2,1)='7', ProdmktOrc), ProdmktOrc )

• ###### Re: Mid function

<ProdmktOrc={"Mid(ProdmktOrc,2,1)=A+Mid(ProdmktOrc,2,1)=1+Mid(ProdmktOrc,2,1)=6+Mid(ProdmktOrc,2,1)=7"}>

or may be

<ProdmktOrc={"Mid(ProdmktOrc,2,1)=A}> + <ProdmktOrc={"Mid(ProdmktOrc,2,1)=1"}> + .....

or

<ProdmktOrc={"?A*"}> + <ProdmktOrc={"?1*"}> + .....