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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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