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

HI ,

I have a dataset like below which has itemid and itemname Diff is Difference

So for id id 123 Amount_1 and Amount_2 are off and for id 456 Amount_1 and Amount_2 are off but for 678 Amount_1,

Amount_2,Amount_3,Amount_4 are off how can we best show in a graph for all the three . Can anyone please help

 

itemid itemname Diff
123 Amount_1 1
123 Amount_2 1
456 Amount_1 1
456 Amount_2 1
456 Amount_3 1
678 Amount_1 1
678 Amount_2 1
678 Amount_3 1
678 Amount_4 1

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

I think a two-way table would do just as well

 

data have;
input itemid itemname $ Diff;
datalines;
123 Amount_1 1 
123 Amount_2 1 
456 Amount_1 1 
456 Amount_2 1 
456 Amount_3 1 
678 Amount_1 1 
678 Amount_2 1 
678 Amount_3 1 
678 Amount_4 1 
;

proc tabulate data=have format=5.0;
class itemid itemname;
var diff;
table itemname, diff*itemid*max="";
run;
PG

View solution in original post

1 REPLY 1
PGStats
Opal | Level 21

I think a two-way table would do just as well

 

data have;
input itemid itemname $ Diff;
datalines;
123 Amount_1 1 
123 Amount_2 1 
456 Amount_1 1 
456 Amount_2 1 
456 Amount_3 1 
678 Amount_1 1 
678 Amount_2 1 
678 Amount_3 1 
678 Amount_4 1 
;

proc tabulate data=have format=5.0;
class itemid itemname;
var diff;
table itemname, diff*itemid*max="";
run;
PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 719 views
  • 2 likes
  • 2 in conversation