IBM Support

Using SELECT IF with a lag function deletes all of my cases in SPSS

Troubleshooting


Problem

I wanted to use a SELECT IF command that deletes cases in SPSS on the basis of a lag function. Say, for example, that I wanted to delete duplicate ID cases in a data set. I used the following syntax: SELECT IF (id ne lag(id)). when I ran this, all my cases were deleted. If I filter the cases, they're all in the file and filtered as they should be. Why does the SELECT IF delete all my cases?

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF014","label":"iOS"},{"code":"PF033","label":"Windows"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

19030

Document Information

Modified date:
16 April 2020

UID

swg21476683