BookmarkSubscribeRSS Feed
Sasbythebook16
Calcite | Level 5

options noxsync noxwait;
/* reference the tagset from support.sas.com */
Filename tpl url
"http://support.sas.com/rnd/base/ods/odsmarkup/tableeditor/tableeditor.tpl";

/* insert the tagset into the search path for ODS templates */
Ods path(Prepend) work.templat(update);
%include tpl;

ods tagsets.tableeditor file="C:\**\temp.html"
options(addfield="Calc1 = value1/value5"
auto_excel="yes"
excel_open="yes"
sheet_name="Data"
pivot_sheet_name="sheetname"
pivotdata="value1, value2, value3, value4, value5, Calc1"
pivotdata_caption="Value 1, Value 2, Value 3, Value 4, Value 5, Calculation 1"
pivotdata_stats="sum, sum, sum, sum, sum, sum"
pivotrow="category1, category2"
pivot_format="light1"
pivotdata_toColumns="yes"
pivotdata_fmt="#,##0~ #,##0~ #,##0~ #,##0~ #,##0~0.00%"
)
;

proc print data=sumtable1; run;

ods tagsets.tableeditor close;

 

After running this code, I receive an error: 

Unable to get PivotFields property of Pivot Table class

 

Please advise.

2 REPLIES 2
Chevell_sas
SAS Employee

Make sure that the table header names in the source worksheet and HTML table match the fields Value1-Value5 that you have included with the PivotData= option. For instance, make sure that you don't have them displayed with labels and use the actual column names in the option. The table headers should match the values specified in the  Pivotdata= option.

 

Thomas10
Calcite | Level 5
Hi , Can you find a solution for this? Thank you in advance. Regards

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 1849 views
  • 0 likes
  • 3 in conversation