proc report data = rank_ratio23 missing ; where rank_ratio ne . and upcase(major_market) = upcase("%bquote(&&mm&i)"); columns MULTIPLE_CUTOFF major_market cat tenure2 title_group fa_code financial_advisor tenure_pos cutoff total_kpi_revenue salary bonus adjuster adjuster = adjusterx total_kpi_revenue = si2 salary = sal2 bonus = bon2 ratio ratiox variance deposit_bal deposit_volume net_deposit loan_bal loan_volume net_loan ; define major_market / 'Major Market' order = data group noprint style(column)=[just = left width=1000% tagattr='wrap:No'] format=$F_MAJMKT. preloadfmt; define cat / "Category" order = data group style(column)=[just = left width=1000% tagattr='wrap:No']; define title_group /'Title^nGroup'; define fa_code /'FA'; define financial_advisor/'Financial Advisor' style(column)=[just = left width=1000% tagattr='wrap:No']; define tenure2 /'Tenure^nCategory^n(Years)' group descending order = internal style(column)=[just = left width=1000% tagattr='wrap:No'] f = tenureb.; define tenure_pos/'Tenure^n(Years)' mean f = comma10.1 ; define ratio/'Ratio' display f=comma10.1 style = [fontweight = bold] noprint; define cutoff/'Cutoff^nRating' order = data display style(column)=[fontweight = bold just = left width=1000% tagattr='wrap:No'] f=cutoff.; define total_kpi_revenue/' spread' noprint ; define salary / 'salary' noprint ; define bonus /'bonus' noprint ; define adjuster/ 'adjuster' noprint ; define ratiox/computed f=comma10.1 style = [fontweight = bold] 'Ratio'; define adjusterx/ mean analysis noprint ; define sal2/analysis sum noprint; define bon2/analysis sum noprint; define si2/analysis sum noprint; define net_loan/"Loan^nTransfers (000s)" format = comma32. style = { htmlstyle="mso-number-format:'#,###'"}; define net_deposit/"Deposit^nTransfers (000s)" format = comma32. style = { htmlstyle="mso-number-format:'#,###'"}; define loan_volume/"Loan^nVolume (000s)" format = comma32. style(column)={cellwidth = 4.0in} style = { htmlstyle="mso-number-format:'#,###'"}; define deposit_volume/"Deposit^nVolume (000s)" format = comma32. style = { htmlstyle="mso-number-format:'#,###'"}; define loan_bal /"Loan^nBalance (000s)" format = comma32. style = { htmlstyle="mso-number-format:'#,###'"}; define deposit_bal/"Deposit^nBalance (000s)" format = comma32. style = { htmlstyle="mso-number-format:'#,###'"}; define multiple_cutoff / noprint; define variance / computed 'Variance' format = comma32.1 style = [fontweight = bold]; compute ratiox; if cutoff = 0 then call define ('ratiox',"style","style=[color = green]"); else call define ('ratiox',"style","style=[color = red]"); endcomp; compute cutoff; if cutoff= 0 then do; call define (_col_,"style","style=[color = green]"); end; else do; call define (_col_,"style","style=[color = red]"); end; endcomp; compute variance; variance = ratiox - MULTIPLE_CUTOFF.sum; if round(variance,0.1)> = 0 then call define ('variance',"style","style=[color = green]"); else call define ('variance',"style","style=[color = red]"); endcomp; break after tenure2/skip; break after major_market/skip; break after cat/skip; rbreak after/skip; compute after major_market ; cat = "Major Market Total"; call define('ratiox',"style","style=[fontstyle = italic color = black fontweight=light]"); endcomp; compute after cat ; cat = "Category Total"; call define('ratiox',"style","style=[fontstyle = italic color = black fontweight = light]"); endcomp; compute after ; cat = "Overall"; call define('ratiox',"style","style=[fontstyle = italic color = black fontweight = light]"); endcomp; compute after tenure2 ; line ' '; endcomp; run;
... View more