TAGSET PIVOT DATA Option

Reply
Occasional Contributor
Posts: 17

TAGSET PIVOT DATA Option


Hi

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?

Super Contributor
Posts: 543

Re: TAGSET PIVOT DATA Option

Posted in reply to srisaipradeep

Could you provide some sample code?

Thanks.

Anca.

Occasional Contributor
Posts: 17

Re: TAGSET PIVOT DATA Option

Posted in reply to AncaTilea

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 */

run;

2. this is to create the pivot table

ods path sasuser.templat(update) sashelp.tmplst(read);

ods tagsets.tableeditor file='c:\temp\table.html';

options

(auto_excel='YES'

button_text='create pivot table'

pivotpage='x,y '

pivotrow='b'

pivotcol='aa'

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'

pivotdata_stats='sum'

pivotcalc='column'

excel_save_file="c:\\temp\\table.xls";

proc print data=chk;

run;

please let me know if you need any other detail.

Thank you..


Super Contributor
Posts: 543

Re: TAGSET PIVOT DATA Option

Posted in reply to srisaipradeep

Hi,

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

Smiley Sad

Maybe someone that does fancy tables in HTML will see this post!

Good luck!

Anca.

Respected Advisor
Posts: 3,799

Re: TAGSET PIVOT DATA Option

Posted in reply to AncaTilea
SAS Super FREQ
Posts: 8,868

Re: TAGSET PIVOT DATA Option

Posted in reply to data_null__

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:

Base SAS: Creating a Data Grid Like VB.NET

cynthia

Ask a Question
Discussion stats
  • 5 replies
  • 403 views
  • 0 likes
  • 4 in conversation