hi all,
can someone please advise how to get this question "BY USING ABOVE TABLES FIND OUT QUARTER WISE (QUARTER LIKE (FOR (JAN FEB MAR ) Q1, (JAN FEB MAR ) Q2,… and so on ) SEGEMENT WISE DISTINCT COUNT OF CUSTOMER AND THERE TOTAL_SPEND".....?
i have attached a screensort for the reference ......!
thanks and regards
varmalh
1) look up the definition of a quarter
2) look up function QTR() and format QTR.
3) try to at least write some code.
4) submit any question that arises to the Forum
in that order.
Thanks PG,
I tried to write some codes and got stuck after 3 codes.
proc format;
value $mfmt "JAN","FEB","MAR"="Q1"
"APR","MAY","JUN"="Q2"
"JUL","AUG","SEP"="Q3"
"OCT","NOV","DEC"="Q4";
run;
proc print data=customers ;
format month$mfmt.;
run;
data a;
set customers;
format month $mfmt.;
run;
proc sql;
create table j as select a.*,segment from a left join customer_seg on a.cust_id=customer_seg.cust_id;
quit;
please advise how to get the correct output.
Thanks
varmalh
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: