a month ago
im unable to convert month to quarter
input Cust_id Month Spend;
1 JAN 100
1 FEB 200
1 MAR 300
2 JAN 400
2 FEB 100
2 MAR 600
3 JUN 100
input CUST_id Segment;
i want output like
QUARTER WISE (QUARTER LIKE ( (JAN FEB MAR ) for Q1 and same for q2 and q3
SEGEMENT WISE DISTINCT COUNT OF CUSTOMER AND THERE TOTAL SPEND.
if in month it would been a no then it was possible but here month are in character .
So should i use sum case with it???
a month ago
Create a value format that converts Jan,Feb,Mar to Q1 (and so on), and use that in a SQL group by, or create a new variable with it, which you can use in by group processing in proc summary etc.
a month ago - last edited a month ago
Use formats to convert your text string months to quarters.
Merge the two data sets.
Use PROC SUMMARY to produce the sums and count of customers.
Also ... hint, hint, hint ... you would be wise to not use text strings such as JAN for months, you make your life simpler if you use numbers for months, 1 is January, 2 is February, and so on, and then converting to quarters is even easier. This advice applies to all calendar data, use either actual numbers, of SAS date values or SAS date/time values, do not use text strings to represent calendar values.