OK then, so in pseudo-code:
If "Math" in Field 1, COMPUTE flag="Math"
If not "Math" in Field 1 but last flag="Math", keep the flag="Math"
If "Reading" in Field 1, COMPUTE flag="Reading"
If not "Reading" in Field 1 but last flag="Reading", keep the flag="Reading"
Is that right?
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Wed August 18, 2021 04:09 PM
From: Art Jack
Subject: Data
It looks like this. Under grade there is one instance of Math, but i need to flag each row below it as math. Until it gets to a 'Reading' in the same column and then flag reading. This goes on for the length of the pdf/excel file.
Grade | | | | | | | | | flag |
Math | | | | | | | | | Math |
Growth | | | | | | | | | Math |
ID | Name | DOB | Gender | Date Created/ SUtpadtuasted | Status | Math |
1 | Art | 21/8/18 | M | | | Math |
2 | Jack | 21/8/18 | M | 8/3/19 | | Math |
Grade | | | | | | | | | Math |
Reading | | | | | | | | | Reading |
Growth | | | | | | | | | Reading |
ID | Name | DOB | Gender | Date Created/ SUtpadtuasted | Status | Reading |
1 | Art | 21/8/18 | M | 8/3/19 | | Reading |
2 | Jack | 21/8/18 | M | 8/3/19 | | Reading |
------------------------------
Art Jack
Original Message:
Sent: Wed August 18, 2021 03:55 PM
From: Rick Marcantonio
Subject: Data
I for one am not clear.
You have converted a PDF to an XLS(X?) file and brought it into SPSS. You have a single field (?), string I presume, that has text in each row. That text can (but need not) include either the word "Math" or the word "Language." You want another variable to have some kind of indicator telling you if a particular row has "Math", "Language," or neither. Really not sure about that last part....
If so, you would use COMPUTE and the INDEX function to find the string value you want in text field. If you want, I can make an example syntax.
If not, then I misunderstood.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Wed August 18, 2021 03:46 PM
From: Art Jack
Subject: Data
I have a pdf that i need to make useful. I've converted the pdf to an excel file. I have one variable that includes the word 'Math' or 'Language' randomly within the field. But I need to flag each row beneath each 'Math' or 'Reading' to be 'Math' or 'Reading' correctly. Hopefully this makes sense. Thanks.
------------------------------
Art Jack
------------------------------
#SPSSStatistics