BookmarkSubscribeRSS Feed
subrat1
Fluorite | Level 6

I have sas table called: EXPOSURE,   I want to write a program in sas to export it to excel hidden sheet called 'premium' and want to create a pivot as shown below.

It should also show the list of value in filter drop down.

MAPPED_COVRG(All)   
RISK_STATE_CD(All)   
YQTR Sum of EARNED_EXPOSURE Sum of WRITTEN_EXPOSURESum of WRITTEN_PREMIUM  Sum of EARNED_PREMIUM
2006Q1                                                 72,538                                                   81,953                                         19,952,490                                       17,344,365
2006Q2                                                 80,291                                                 105,219                                         25,223,946                                       19,261,388
2006Q3                                                 89,390                                                 107,191                                         25,492,690                                       21,529,784
2006Q4                                                 97,905                                                 112,642                                         27,227,132                                       23,607,847
2007Q1                                               105,448                                                 123,325                                         29,741,038                                       25,450,573

 


pivot.PNG
2 REPLIES 2
Reeza
Super User

This isn't a trivial task. 

 

If you search on here you'll find some solutions for this situation, but the main issues are

 

1) export to specific location

2) create/update pivot table

 

A common work around is to create a template that is updated, source data replaced and there's an embedded Excel macro that refreshes the pivot table. Given that your using EG, you can't use DDE. Can you use an Excel macro? How are you envisioning this process working on your side?

LinusH
Tourmaline | Level 20
Sounds like a job for the SAS Addin for MS Office.
With that you could either let your pivot access SAS data directly, or have a Stored Process update the sheet data.
Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1922 views
  • 0 likes
  • 3 in conversation