Hi.
I first was thinking of suggesting the VARSTOCASES command for at least part of this task, but since your 'otherSlots' variable can take multiple arguments, that's not going to work.
I think a Python solution is the only feasible one.
It will take me some time to get to it. Jon Peck is such an expert that he may already have a solution half-way or completely written by now. In any event, if you know Python, I would suggest giving it a try in a BEGIN PROGRAM / END PROGRAM block.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Sun October 16, 2022 02:51 PM
From: Bruna Kapaj
Subject: How can SPSS Split Time Range by the Hour for each Row?
Hello everyone and thank you in advance for your time,
I have a data set similar to the one below. I want to get the duration for each participant AND for each time slot.
For example:
- Participant 1
- Slot 8
- Slot 19
- Duration 5min (sum of duration from both rows: 3 and 4)
The problem is for the rest of the rows.
In Row 5:
- Participant 2
- Duration is actually 1m 28sec but the Slot should be split in slot 19 and slot 20
- Slot 19
- Slot 20

Is there anyway SPSS can help me duplicate such rows and change their startTime and endTime such as:

Thank you!
------------------------------
Bruna Kapaj
------------------------------
#SPSSStatistics