## Calculated Item question

Solved
Occasional Contributor
Posts: 8

# Calculated Item question

I am working with a group of customers that have responded to various source codes.  Some source codes start with a number and some start with a letter which differentiates different sales avenues.  What I am looking to do is to group these into two groups by assigning a logic statement as a calculated item.  Something like.

If (source code) begins with a letter assign a 1 if not a 0.

I was playing with the following: (actual screenshot attached below)

If

substring (data field) 1, 1

= ( blank )

returns 1

else 0

but i didn't know if that would work as i don't know how to tell it to identify a letter in the blank field.  Does this make sense?  Can someone help me?

Accepted Solutions
Solution
‎05-03-2018 07:13 AM
PROC Star
Posts: 399

## Re: Calculated Item question

Could this work?

//Fredrik

All Replies
Solution
‎05-03-2018 07:13 AM
PROC Star
Posts: 399

## Re: Calculated Item question

Could this work?

//Fredrik

Occasional Contributor
Posts: 8

## Re: Calculated Item question

Fredrik,

Thank you.  This worked brilliantly.  I appreciate you taking the time to help me on this.  Stay tuned as I am new to SAS, I'm sure I will be looking for additional assistance.

Community Manager
Posts: 746

## Re: Calculated Item question

I'm glad you found some useful info! If @FredrikE's reply was the exact solution to your problem, can you "Accept it as a solution"? Or if one was particularly helpful, feel free to "Like" it. This will help other community members who may run into the same issue know what worked.

Thanks and looking forward to "seeing" you on the community!
Anna

☑ This topic is solved.