SPSS Statistics

 View Only

 LTRIM

Patrick Fisher's profile image
Patrick Fisher posted Fri February 20, 2026 07:13 PM
COMPUTE NewStringVar = LTRIM(OldStringVar).
EXECUTE.

That does not work. It was suggested by Google AI as a fix.

SPSS is trying to tell me that I'm attempting to do this with conflicting variables (string-numeric). I'm not. I converted my numeric variable into a string variable to get around this problem.

I have 6 and 7 leading spaces in front of my 1-80 data in my variable.

How do I get rid of those spaces?

Thanks,

Patrick

Jon Peck's profile image
Jon Peck IBM Champion

SPSS. Is complaining that the right hand side is a string but the left would be numeric.  You need to declare it with the STRING command before the COMPUTE