TAILIEUCHUNG - SAS 9.1 SQL Procedure- P4

Tham khảo tài liệu 'sas sql procedure- p4', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 146 Creating a Summary Report A Chapter 6 to calculate the sum of each month s sales then uses the SUM function a second time to total the monthly sums into one grand total. sum calculated JanTotal calculated FebTotal calculated MarTotal as GrandTotal format dollar10. An alternative way to code the grand total calculation is to use nested functions sum sum January sum February sum March as GrandTotal format dollar10. Creating a Summary Report Problem You have a table that contains detailed sales information. You want to produce a summary report from the detail table. Background Information There is one input table called SALES that contains detailed sales information. There is one record for each sale for the first quarter that shows the site product invoice number invoice amount and invoice date. Output Sample Input Table for Creating a Summary Report Sample Data to Create Summary Sales Report Site Product Invoice Invoice Amount InvoiceDate V1009 VID010 V7679 980126 V1019 VID010 V7688 980126 V1032 VID005 V7771 1070 980309 V1043 VID014 V7780 1070 980309 V421 VID003 V7831 2000 980330 V421 VID010 V7832 750 980330 V570 VID003 V7762 2000 980302 V659 VID003 V7730 1000 980223 V783 VID003 V7815 750 980323 V985 VID003 V7733 2500 980223 V966 VID001 V5020 1167 980215 V98 VID003 V7750 2000 980223 You want to use this table to create a summary report that shows the sales for each product for each month of the quarter. Solution Use the following PROC SQL code to create a column for each month of the quarter and use the summary function SUM in combination with the GROUP BY statement to accumulate the monthly sales for each product Please purchase PDF Split-Merge on to remove this watermark. Practical Problem-Solving with PROC SQL A How It Works 147 proc sql title First Quarter Sales by Product select Product sum Jan label Jan sum Feb label Feb sum Mar label Mar from select Product case when substr InvoiceDate 3 2 01 then InvoiceAmount end as Jan

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.