Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

If Then Condition

Dear all

This is a simple problem but not sure why I am unable to get the correct answer. 

tracycrown_0-1602925073181.png

Thank you, Tracy

Labels (1)
2 Solutions

Accepted Solutions
Highlighted
MVP
MVP

If you want only to edit your expression without changing script then you can use below expression.

 

Max(Aggr(If(sum(Score)>= sum(Lower) and sum(Score) <= sum(Upper),Grade),Student, Subject, Score,Lower,Upper))

or

only(Aggr(If(sum(Score)>= sum(Lower) and sum(Score) <= sum(Upper),Grade),Student, Subject, Score,Lower,Upper))

or

Aggr(If(sum(Score)>= sum(Lower) and sum(Score) <= sum(Upper),Grade),Student, Subject, Score,Lower,Upper)

View solution in original post

Highlighted
Creator III
Creator III

Dear MK_QSL

Thank you so much for your kind and quick response, your methods (Script & Expression) are VERY useful and just in time for me to resolve the issue.

Thank you, Tracy

 

 

View solution in original post

4 Replies
Highlighted
MVP
MVP

Try something like below...

 

Result:
LOAD Year,
Student,
Subject,
Score
FROM
[Test-1.xlsx]
(ooxml, embedded labels, table is Result);

Grade:
LOAD Grade,
Lower,
Upper
FROM
[Test-1.xlsx]
(ooxml, embedded labels, table is Grade);

IntervalMatch:
IntervalMatch(Score)
Load Distinct Lower, Upper Resident Grade;

Left Join (IntervalMatch)
Load * Resident Grade;

Drop Table Grade;
Drop Fields Lower, Upper;

Highlighted
MVP
MVP

If you want only to edit your expression without changing script then you can use below expression.

 

Max(Aggr(If(sum(Score)>= sum(Lower) and sum(Score) <= sum(Upper),Grade),Student, Subject, Score,Lower,Upper))

or

only(Aggr(If(sum(Score)>= sum(Lower) and sum(Score) <= sum(Upper),Grade),Student, Subject, Score,Lower,Upper))

or

Aggr(If(sum(Score)>= sum(Lower) and sum(Score) <= sum(Upper),Grade),Student, Subject, Score,Lower,Upper)

View solution in original post

Highlighted
Creator III
Creator III

Dear MK_QSL

Thank you so much for your kind and quick response, your methods (Script & Expression) are VERY useful and just in time for me to resolve the issue.

Thank you, Tracy

 

 

View solution in original post

Highlighted
Creator III
Creator III

Dear MK_QSL

Sorry to trouble you again as I have encountered another problem after adding a new field, Term.

Table A - Grade is OK

Table B - Grade is wrong if using average score ? 

Table C - Not sure why I cannot use sum(Lower) and sum(Upper) in expression ?

Thank you in advance for your advice again, Tracy