I have a data set and I need to group the type of member "mem" and get a grand total at the bottom. When I am trying to limit the number of members to group, i am still getting the grand total for all the members. data have; input mem $ frequency percent; datalines; M 240 24.0 M 320 32.0 F 120 12.0 M 80 8.0 C 68 6.8 M 42 4.2 C 130 13.0 ; run; Proc Sql; Create table Game as select mem as Member , count(frequency) as Freq , sum(percent) as Percent from have group by mem having mem in ("C", "F") union Select "Grand tot" as mem ,count(frequency) as Freq ,sum(percent) as Percent from have; Quit; The output that I am getting is Obs Member Freq Percent 1 C 2 19.8 2 F 1 12.0 3 Grand tot 7 100.0 The Grand tot is not giving the value for the selected number of "mem". I tried by putting the having clause in the second part of the union too, however I did not achive results. Please suggest a viable option. Thanking you!
... View more