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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.