Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sofiavaz
Contributor

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

1 Solution

Accepted Solutions
MVP
MVP

Re: Mid function

How about this

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

5 Replies
MVP
MVP

Re: Mid function

How about this

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

b_knuever
Contributor III

Re: Mid function

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

agigliotti
Honored Contributor II

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 )

zebhashmi
Valued Contributor

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*"}> + .....


sofiavaz
Contributor

Re: Mid function

Thank You Sunny, it's working!