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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.