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

Hello
I want to display values in millions.
The row data is displayed in thousands.
for example: value 1000 is 1 million, value 2000 is 2 million....
I want that the summary table of proc report will display values(sum ) in millions.

Data tbl;
input ID Team $ y;
cards;
1 a  1000
2 a  2000
3 a  3000
4 b  4000
5 b  5000
;
run;

proc report data=tbl nowd;
  column Team y ;
  define Team / group;
  define y / analysis sum;
  rbreak after / summarize;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
rudfaden
Pyrite | Level 9

proc format;
picture million (round fuzz=0)
0 -high = '009.999.999' (prefix='' mult=1000);
run;

proc report data=tbl nowd;
  column Team y ;
  define Team / group;
  define y / analysis sum;
  format y million.;
  rbreak after / summarize;
run;

View solution in original post

4 REPLIES 4
rudfaden
Pyrite | Level 9

Try using a picture format

 

Data tbl;
input ID Team $ y;
cards;
1 a  1000
2 a  2000
3 a  3000
4 b  4000
5 b  5000
;
run;

proc format;
picture million (round fuzz=0)
0 -high = '9.999.999' (prefix='' mult=1000);
run;

proc report data=tbl nowd;
  column Team y ;
  define Team / group;
  define y / analysis sum;
  format y million.;
  rbreak after / summarize;
run;
Ronein
Meteorite | Level 14

Thank you very much.

I want to get different results.

For  "a"  will get value 6 (because it is 6 millions)

For  "b"  will get value 9 (because it is 9 millions)

For total will get value  15(because it is 15  millions)

However :

In your outcome I see  6.000.000 for "a"

In your outcome I see  9.000.000 for "b"

In your outcome I see  5.000.000 for 'total' (which is error anyway)

 

 

 

PaigeMiller
Diamond | Level 26

@Ronein wrote:

I want to get different results.

For  "a"  will get value 6 (because it is 6 millions)

For  "b"  will get value 9 (because it is 9 millions)

For total will get value  15(because it is 15  millions)

However :

In your outcome I see  6.000.000 for "a"

In your outcome I see  9.000.000 for "b"

In your outcome I see  5.000.000 for 'total' (which is error anyway)

 


Certainly, you could make the very simple change to the Picture format yourself and solve the problem.

--
Paige Miller
rudfaden
Pyrite | Level 9

proc format;
picture million (round fuzz=0)
0 -high = '009.999.999' (prefix='' mult=1000);
run;

proc report data=tbl nowd;
  column Team y ;
  define Team / group;
  define y / analysis sum;
  format y million.;
  rbreak after / summarize;
run;

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
  • 4 replies
  • 1629 views
  • 1 like
  • 3 in conversation