Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Logical and or with match

I hava a problem with the following code:

Load

name,

1 as _Flag

Where

  ( Match(COURSE ,'ENG2', 'ENG3') or Match(GRADE,'E', 'D','C', 'B','A' ))

  And (Match(COURSE,  'MATH5') or Match(GRADE, 'E', 'D','C', 'B','A' ))

Meaning that if a person attended both of the courses in English and got a valid grade and also attended the 'MATH5' class and got a valid grade in that course too then the Flag=1

I get to many records when I run the code above and not sure what I'm thinking wrong.

2 Replies
MVP
MVP

Re: Logical and or with match

from your question I think you only want the result in bold in my testdata

testdata:

load * inline [

name, COURSE, GRADE

m, ENG2, A

m, ENG3, A

m, MATH5, A

n, ENG2, A

n, ENG3, A

o, HIS, A

o, ENG3, A

o, MATH5, A

p, ENG2, F

p, ENG3, A

p, MATH5, A

];

result:

load name, if(NUM=3,1,0) as Flag;

load

  name,

  count(DISTINCT COURSE) as NUM

resident testdata

where match(COURSE, 'ENG2','ENG3','MATH5') and match(GRADE,'E', 'D','C', 'B','A' )

group by name;

1.png

Not applicable

Re: Logical and or with match

Thank's :-). That was the solution

Community Browser