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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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