- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
From this table:
DATA SALE;
INPUT FILE $ TYPE $ VAR1 ;
CARDS;
1254 100A 52
3652 200 36
1254 100A 36
3652 200 65
3652 200 6
2541 300 65
;
RUN;
I did a proc tabulate:
PROC TABULATE
DATA=SALE;
VAR VAR1;
CLASS FILE / ORDER=UNFORMATTED MISSING;
TABLE
/* Dimension de ligne */
FILE={LABEL=""},
/* Dimension de colonne */
VAR1* Sum={LABEL=""}*F=BESTX12.
/* Options de la table */
/ BOX={LABEL="FILE"} ;
;
I would like to achieve the following result:
Each file has the same type. As it is a character variable, I don't know how to integrate it into the proc tabulate.
Thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Unless there are other bits you aren't showing then perhaps this is more of a PROC Report item.
proc report data=sale; columns file type var1; define file/group; define type/group; define var1 / 'sum_var1'; run;
Report by default will sum numeric variables. You can see how to provide the column heading text other than the default variable label.
Tabulate could look like this but aligning multiple row headings can be problematic if that is critical.
PROC TABULATE DATA=SALE; VAR VAR1; CLASS FILE / ORDER=UNFORMATTED MISSING; class type; TABLE /* Dimension de ligne */ FILE={LABEL=""} * type='', /* Dimension de colonne */ VAR1* Sum={LABEL=""}*F=BESTX12. /* Options de la table */ / BOX={LABEL="FILE Type"} ; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Unless there are other bits you aren't showing then perhaps this is more of a PROC Report item.
proc report data=sale; columns file type var1; define file/group; define type/group; define var1 / 'sum_var1'; run;
Report by default will sum numeric variables. You can see how to provide the column heading text other than the default variable label.
Tabulate could look like this but aligning multiple row headings can be problematic if that is critical.
PROC TABULATE DATA=SALE; VAR VAR1; CLASS FILE / ORDER=UNFORMATTED MISSING; class type; TABLE /* Dimension de ligne */ FILE={LABEL=""} * type='', /* Dimension de colonne */ VAR1* Sum={LABEL=""}*F=BESTX12. /* Options de la table */ / BOX={LABEL="FILE Type"} ; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ok thank you, the PROC REPORT is effectively simpler.