Create a fully summarized table for OLAP Cubes

5

SAS procedure SUMMARY is a quick method of converting your detail table to a fully summarized one.
Included is a sample. The key option to set is the NWAY - this generates the lowest level of summary for use in the OLAP cube.

Essentially - the class statement contains all the levels used in the various dimensions, the var statement lists all the variables analyzed, and the output statement lists the statistics and new variable names. Other statistics are available - reference the proc MEANS documentation for other output statement options.

        proc summary data=sashelp.shoes nway;

                class region subsidiary product;
                var sales returns;
                output out=new sum(sales)=sales_sum max(sales)=sales_max max(returns)=returns_max;
        run;

References

Share

About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Related Posts

5 Comments

  1. Thank you for your answer. I have used NUNIQUE before, but then the unique count is only available to a certain dimension. My customer would like these unique counts to be available to several dimensions, just like a "normal" measure.

  2. Hi,I would like to create a cube on a summarized table, but I can't use proc summary because it doesn't support unique counts. When will the ability to count distinct values and not just N be available when using proc summary?

Leave A Reply

Back to Top