Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
See here the 'problem'
First column contains observation number.
Second column Class contains scores 'Y'.
What I would like to get:
A field 'Output' where only one 'Y' is visible as representative for the groups of 'Y'.The empty space in the previous cell in field Class marks the position of 'Y' in the cell of field Output.
I suppose that shoudl be solved using peek function, but could you demonstrate an efficient solution?
Thanks,
Cornelis.
LOAD
Obs,
Class,
If(Class='Y' and Previous(Class) <> 'Y', Y) as Output
FROM
...source data...
;
LOAD
Obs,
Class,
If(Class='Y' and Previous(Class) <> 'Y', Y) as Output
FROM
...source data...
;
Hi Gysbert,
That is indeed the best solution and apparently very easy.
A little correction:
If(Class = 'Y' and Previous(Class) <> 'Y', 'Y') as Output
not Y but 'Y'.
Best regards,
Cornelis