Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing a SAS proc sql query to achieve the problem below please: Using In-Line Views Produce a report of Orion Star sales

I need help writing a SAS proc sql query to achieve the problem below please:

image text in transcribed

Using In-Line Views Produce a report of Orion Star sales force employees' aggregate sales in 2011. a. Select the Country, First_Name, Last_Name, Value_Sold, Orders, and Avg_Order columns by joining the orion.order_fact and orion.sales tables on Employee_ID. Group the report by Country, First_Name, and Last_Name. Include only employees having an aggregate Value_Sold of $200.00 or more. Order the results by Country, Value_Sold (descending), and Orders (descending). - Calculate Value_Sold by summing Total_Retail_Price. - Calculate Orders by using the count(distinct Order_ID) function to count the number of unique rows for each employee. An employee can have multiple Order_ID row values for different products. Rows with the same order ID do not count as a separate order. - Calculate Avg_Order by dividing Value_Sold by Orders. - Subset the data to return only the rows for sales in 2011. - Title the report as indicated in the sample output. Partial PROC SQL Output b. Rewrite the query created in part a above and use it as an in-line view. Select Country and the maximum Value_Sold, Orders, and Avg_Order values, as well as the minimum Avg_Order value for each country. Name the report 2011 Sales Summary by Country. Hint: An in-line view cannot use the ORDER BY clause

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Analyse the various techniques of training and learning.

Answered: 1 week ago