01-29-2013 07:15 AM
I am trying to creat a piovt table in excel using the sas option - tagset in sas.
i used to proc freq . it delivers two variables one is count and othe is percent as the analysis variable.
Count option is work in tagset while using it under pivotdata='count' , but i want pivotdata='percent'. this is not working can you please guide?
01-29-2013 11:26 PM
Thank you for the reply Anca.
Please find below the sample code
1. This code is to creat the frequency
proc freq data=xxx;
tables br*mkt*aa1*ba11*own / out=chk;
weight weight; /*** this code generates count and percent in the output */
2. this is to create the pivot table
ods path sasuser.templat(update) sashelp.tmplst(read);
ods tagsets.tableeditor file='c:\temp\table.html';
button_text='create pivot table'
pivotdata='count' /*** here i would like sas to pick percent instead of count and doing the sum . but whts happenign its picking percent but instead of having pivotdata_stats as sum its take it as 'COUNT of percent' but i want 'Sum of Percent'
proc print data=chk;
please let me know if you need any other detail.
01-30-2013 10:07 AM
Unfortunately I am having a hard time even getting the TableEditor working.
So, I thought it would be easier for me to figure it out from the code...but I can't
Maybe someone that does fancy tables in HTML will see this post!
01-30-2013 11:57 AM
Hi, data_null_ -- I guess we think alike! Or at least we Google the same! I was just going to post that link too.
The only other thing I wanted to point out was that I was confused by the OP's comment that they were trying to make a pivot from a PROC FREQ, which seemed sort of strange to me. Generally, when I do make pivots, I use the "detail" data and then use PIVOT_STATS suboption for controlling the statistics (as shown in the Tech Support note).
For more info about TAGSETS.TABLEEDITOR, this is the main web site with examples: