BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidDemeyer
Calcite | Level 5

Hi everyone,

I'm quite new to SAS Enterprise Guide and I would like to clean up my data before analysis.

I have a variable OnlineCustomer that uses 3 possible ways to be TRUE and 2 ways to be FALSE.

null, -1 and 0 should be FALSE

1 or [the customerID] should be TRUE

How can I convert al the values to the correct TRUE/FALSE-value so I can easily work with expressions?

Thanks,

David

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

In SAS you can recode the variables in a task I believe OR you could create a custom format and then use the data as is, if you needed it further.

EDIT:

To recode:

Use query builder>Computed Column> check the RECODE radio button

For Format, it is under Tasks>Data>Create Format

View solution in original post

2 REPLIES 2
Reeza
Super User

In SAS you can recode the variables in a task I believe OR you could create a custom format and then use the data as is, if you needed it further.

EDIT:

To recode:

Use query builder>Computed Column> check the RECODE radio button

For Format, it is under Tasks>Data>Create Format

DBailey
Lapis Lazuli | Level 10

If you're using the query wizard, you can add a computed column either via the recode as described or if you're feeling adventurous create one using the advanced option and name it bolOnlineCustomer.  The formula would be something like:

Onlinecustomer=1 or OnlineCustomer=[the customerid].

If either of those are true, the formula returns a true.  I'm presuming that your customerid's are all numeric

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 876 views
  • 3 likes
  • 3 in conversation