The SAS Output Delivery System and reporting techniques

Formatting pivot rows and selecting pivotpage and pivotrow values in tagset tableeditor

Reply
Occasional Contributor
Posts: 5

Formatting pivot rows and selecting pivotpage and pivotrow values in tagset tableeditor

Hello

I have the following code that exports a dataset into a pivot table in Excel using tableeditor:

ods tagsets.tableeditor file="H:\EGtask\dim3su\example1.html"

options(

auto_excel = "yes"

pivotrow = "cpr,inddto,drg,totpris_rsd,adiag,proc1,proc2,proc3,proc4,proc5" /*HELP! */

pivotdata = "antal_rsd"

pivotpage = "kvartal,aar,sghafd_rsd" /*HELP! */

pivot_subtotal = "no"

delete_sheets = "ark1,ark2,ark3"

pivot_sheet_name = "Pivot"

sheet_name = "Data"

/*pivotrow_fmt = "" HELP! */

excel_save_file="H:\EGtask\dim3su\example1.xlsx"

quit="NO"

);

  proc print data=test2;

  run;

  ods tagsets.tableeditor close;

I have 3 problems:

a) The variable 'cpr' is a character variable in SAS, that contains numeric values starting with '0'. The created pivottable treats 'cpr' as a numeric variable, thus deleting the '0's.

I want to define 'cpr' as a character variable in the 'pivotrow_fmt' statement, but I don't know how.

b) Is there a way to select given values of the 'pivotpage' variables so they are selected when the Excel sheet opens?

c) Is there a way to sort some of the 'pivotrow' variables by given values, so they are sorted when the Excel sheet opens?

Any help is greatly appreciated.

I apologize for my rusty English.

Post a Question
Discussion Stats
  • 0 replies
  • 520 views
  • 0 likes
  • 1 in conversation