BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I have a sas data set that am trying to open it into a pivot table using sas add in.
The data set that I have has

Month State City crime rate
200901 TX Dallas 57
200812 TX Dallas 55
200812 TX Houston 45
200810 ny Long island 21

When I try to open the above data set like
Table 1
Month 200901 200812
State
TX Dallas 57 55

Table 2

Month 200901 200812
State
TX Houston 57 55

Table 3

Month 200810
State
ny Long island 21


I want to get values 0 and if the data is not present for the month. It should start from the latest month available in teh data set and run to 12 months past that date.

How can I do that?

Any help is much appreciated. My goal is to look for the same months across all the pivot tables and if there is not data then it should write zero in it.

Please help
1 REPLY 1
Bill
Quartz | Level 8
Although your example is not clear to me, maybe I can help.

SAS can't write any data to the pivot table that isn't contained in the data set. If you want to display a zero month in the pivot table, you need to build a zero month in the SAS data set first, e.g. 200902 TX Dallas 0

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!

Discussion stats
  • 1 reply
  • 620 views
  • 0 likes
  • 2 in conversation