BookmarkSubscribeRSS Feed
chandru1dev
Fluorite | Level 6

Hi,

 

I am using the below script for creating the excel pivot table. Can you please help for the below 2 issues

 

1) I am able to create the excel with the pivot, but I could not save the excel automatically. The excel opens and promts me to save.

    Error: Unable to set the Orientation property of the PivotField class

    Also I tried using excel_save_file option, before trying update_target

2) I need to suppress the sub totals and I want only the grand total


/* Create file to update */
ods tagsets.Excelxp file="c:\temp.xls" options(sheet_name="temp") ;
proc print data=fin_all;
run;
ods tagsets.Excelxp close;

/* update the file with a simple pivot table by creating a javascript file that we execute */
options xnowait noxsync;
ods noresults;
ods tagsets.tableeditor file="C:\temp.js"
options(output_type="script"
update_target="c:\\temp.xls"
sheet_name = "temp"

pivotrow="Name, ID, TGT_NOS"
PIVOTDATA_TOCOLUMNS="YES"
pivotpage="AREA, LOC_CD, LOCATIONNAME, product, ACTIVITY_DATE");
data _null_;
file print;
put "test";
run;
ods tagsets.tableeditor close;
/* execute Script file */
x "C:\temp.js";

 

1 REPLY 1
chandru1dev
Fluorite | Level 6

Hi

 

I resolved the orientation error

 

Can anybody share your idea for resolving

1. To save the excel ouput file automatically?

2. To eliminate the sub totals

 

Thanks

Chandramohan

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 1007 views
  • 0 likes
  • 1 in conversation