BookmarkSubscribeRSS Feed
merahilyana
Fluorite | Level 6

how to create new variable with calculation between 2 variables in same table.?

 

eg: In table population, If id = 1 and id=5 then count(people).

3 REPLIES 3
Reeza
Super User

It's not clear what you want. Are you adding a row or column?

Can you show an example of what you have and what you want?

 


@merahilyana wrote:

how to create new variable with calculation between 2 variables in same table.?

 

eg: In table population, If id = 1 and id=5 then count(people).


 

merahilyana
Fluorite | Level 6

Capture.JPG

 

bumiputera = 1 and warganegara = 5, want be like this:

 

Capture.JPG

Reeza
Super User
It looks like you're generating a report, so you should be using PROC REPORT and INDENT option to allow your values to be indented. PROC TABULATE also allows indents. If this doesn't answer your question, please post more details. Your above screenshots don't show much additional information, i have no idea what bumiputera=1 and warganegara = 5 mean.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 444 views
  • 0 likes
  • 2 in conversation