November 2, 2022 at 4:56 pm
Hi,
I am trying to process results to this question:
"What optional subjects do you study?"
Results could be one or many of these options:
1 Option1
2 Option2
8 None
9 NotKnown
I would like to check if results for each student are valid or not by checking these rules:
If duplicate codes then invalid result
if 8 & another code then invalid result
if 9 & another code then invalid result
[Options table]
1 Option1
2 Option2
8 None
9 NotKnown
[Answers table]
Student Answer
100 1
100 2
101 1
101 9
Student 100 answers are valid.
Student 101 answers are not valid because they break rule number3
Which is the best way to implement these 3 rules ?
TIA
November 2, 2022 at 5:48 pm
Are your results already in a table?
Sounds like these are all separate questions... Could you post a script that creates and populates a table with your sample data?
November 2, 2022 at 10:46 pm
Hi, I am trying to process results to this question: "What optional subjects do you study?"
Results could be one or many of these options: 1 Option1 2 Option2 8 None 9 NotKnown
I would like to check if results for each student are valid or not by checking these rules:
If duplicate codes then invalid result if 8 & another code then invalid result if 9 & another code then invalid result
Which is the best way to implement these 3 rules ? TIA
Please identify he table structure of the "answers" table. Also, please identify what "duplicate code"s consists of if not a part of the 3 rules you posted.
In the meantime, use CASE from the bottom up because CASE is evaluated from the top down.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 3, 2022 at 12:09 pm
[Options table]
1 Option1
2 Option2
8 None
9 NotKnown
[Answers table]
Student Answer
100 1
100 2
101 1
101 9
Student 100 answers are valid.
Student 101 answers are not valid because they break rule number3
November 3, 2022 at 5:54 pm
[Options table] 1 Option1 2 Option2 8 None 9 NotKnown
[Answers table] Student Answer 100 1 100 2
101 1 101 9
Student 100 answers are valid. Student 101 answers are not valid because they break rule number3
There don't appear to be any question numbers in either of those tables.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 3, 2022 at 5:57 pm
You also list the 3 conditions, as follows...
If duplicate codes then invalid result
if 8 & another code then invalid result
if 9 & another code then invalid result
For the first rule, are you suggesting that a student could answer, for example, with an "8" more than once for the same question?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply