BookmarkSubscribeRSS Feed
HashimBasheer
Fluorite | Level 6

I have a requirement for a report.

The output should be a crosstab report with total 3 columns.

1. Category(loan type,term loan, utlilization etc)

2. Months and yetd value(january14,february14....YTDFy1415)

3. $ amount.

The problem is In the crosstab report, if I give month values as character it wont be sorted in the desired order.How can I get the columns in the corrected order? I cant use the list report for this as the Month values wil get changed on a timely basis. Is there any way if we can get the months sorted in the below order (without adding prefixes)

Month values shud be sorted as below.

Jan - 14

Feb -14

Mar-14

.

.

.

YTDFY1415

4 REPLIES 4
ballardw
Super User

A generic and across the board pretty powerful approach is to create a SAS date variable and use those with appropriate formats.

HashimBasheer
Fluorite | Level 6

thanks for the response. Now I have all the period values in one column, how can I apply the different formats?

HashimBasheer
Fluorite | Level 6

thanks for the response. Now I have all the period values in one column, how can I apply the different formats? I tried creatting date variables for the variables and for the ytd columns, I gave some future date so that it comes last in the sequence. But the business would like to see the YTD column as YTD_FY13-14. How wecan achieve this? I tried user defined formats. For some reasons its not getting displayed in the infomaps

ballardw
Super User

The method may depend, or be more specific, if you can show how you are generating the crosstab. There are different approaches depending on the procedure used.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 6575 views
  • 0 likes
  • 2 in conversation