help with selecting whether a variable contains some numbers

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Vivian
Posts: 3
Joined: Mon Jun 25, 2012 9:33 pm

help with selecting whether a variable contains some numbers

Postby Vivian » Tue Sep 04, 2012 9:22 am

Hi there,

I have one variable defining a trend using 1,2,3...for example, this numeric variables contains:

Trend
1122333311
3331112211
1233331122
...

This variable contains 13 or 14 digits. I want to indicate if this variable contains "3311" in any where of the variable.

Could anybody let me know how to write the syntax?

Thank you very much!
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: help with selecting whether a variable contains some num

Postby Penguin_Knight » Tue Sep 04, 2012 11:14 am

Convert the variable into a string variable, and then use Transform > Compute, look for the "Char.Index" function under the string section.

Who is online

Users browsing this forum: No registered users and 2 guests

cron