Subtotals in SAS

Posted on 2011-10-24
Last Modified: 2013-11-16
I have a file that is sorted by member within team. I would like to subtotal by member within team id.
(See attached file)

I would like to total by units_calc.

Question by:morinia
    LVL 1

    Expert Comment


    proc sort data=yourdata;
    var  team_id member;

    proc means data=yourdata sum;
    by team_id member;
    var units_calc;

    That should do it.

    Author Comment


    This is what I coded.  However, I only get the totals by member.  It is not giving me the totals by team.
    LVL 1

    Accepted Solution

    Sounds likeyou need two reports.

    One with just by team;
    and then one by member?
    Send a sample of what's wrong and a mock up of what you would like

    Author Closing Comment

    I created two files and then did a merge.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
    Read about achieving the basic levels of HRIS security in the workplace.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now