1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using...

39
1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries

Transcript of 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using...

Page 1: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

1

Chapter 6: Using Prompts in Tasks and Queries

6.1 Prompting in Projects

6.2 Creating and Using Prompts in Tasks

6.3 Creating and Using Prompts in Queries

Page 2: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

2

Chapter 6: Using Prompts in Tasks and Queries

6.1 Prompting in Projects6.1 Prompting in Projects

6.2 Creating and Using Prompts in Tasks

6.3 Creating and Using Prompts in Queries

Page 3: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

3

Objectives Define a prompt. Illustrate examples of prompts.

Page 4: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

4

PromptsPrompts enable you to request input from the user when a task, query, or SAS program is run.

Internet Sales

Page 5: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

5

Prompt ExamplesPossible prompts include the following:

Datevalues

Variable lists

Text ornumeric entry

Single or multipleselection from a list

Page 6: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

6

Prompt ManagerPrompts are stored within a project. You can use the Prompt Manager section of the Resources pane to create, edit, and delete prompts. You can define prompts that require the user to select or type one or more values when a query or task is run.

Page 7: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

7

Page 8: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

8

Setup for the Poll1. Open the e106a01.egp project.

2. Select Yes when you are prompted to run the Autoexec process flow.

3. In the Specify Values for Project Prompts window, do the following: From the Customer Age Group menu, select

31-45 years. In the Orders with profits exceeding field,

type 100.

4. Run the query.

Page 9: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

9

6.01 Multiple Choice PollHow many rows were returned in the query result?

a. 0

b. 58

c. 76

d. 617

Page 10: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

10

6.01 Multiple Choice Poll – Correct AnswerHow many rows were returned in the query result?

a. 0

b. 58

c. 76

d. 617

Partial Results

Page 11: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

11

Chapter 6: Using Prompts in Tasks and Queries

6.1 Prompting in Projects

6.2 Creating and Using Prompts in Tasks6.2 Creating and Using Prompts in Tasks

6.3 Creating and Using Prompts in Queries

Page 12: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

12

Objectives List steps for adding a prompt to a task. Define general prompt properties. Define the prompt type and values. Retrieve prompt values from a data source. Use prompts in a task.

Page 13: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

13

Business ScenarioThe CEO at Orion Star would like the ability to view a pie chart that illustrates the distribution of profit based on different categories. Rather than creating a separate pie chart for each category, he wants to be able to access a single task, but choose, at run time, the variable to analyze.

Page 14: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

14

Prompts in TasksAdding a prompt to a task is a two-step process.

1. Create a prompt.

2. Use the prompt definition in a task.

Page 15: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

15

Creating a PromptYou can create prompts by accessing the Prompt Manager in the Resources pane.

Select Add to begincreating a new prompt.

Page 16: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

16

Creating a Prompt: GeneralWhen you create a prompt, you must first specify the general properties of the prompt, such as the name, displayed text, description, and options.

Page 17: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

17

Page 18: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

18

6.02 Multiple Answer PollWhich of the following are valid names for prompts?

a. Select Country

b. Select_a_Category

c. Profit$Segments

d. 1stQtrValues

e. Qtr1Values

Page 19: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

19

6.02 Multiple Answer Poll – Correct AnswersWhich of the following are valid names for prompts?

a. Select Country

b. Select_a_Category

c. Profit$Segments

d. 1stQtrValues

e. Qtr1Values

Names can contain only alphanumeric characters and underscores, cannot begin with a number, and cannot exceed 32 characters.

Page 20: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

20

Creating a Prompt: Prompt Type and ValuesBy selecting Variable as the Prompt type, you can assign the prompt to task roles in tasks.

The prompt value list can be populated by the variable names from an existing data source.

Page 21: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

21

Using a Prompt: Variable TypeVariable type prompts appear in tasks as an additional variable that can be assigned to task roles or used in titles and footnotes.

Page 22: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

22

Prompting in Tasks

This demonstration illustrates how to create a variable prompt for use in a task.

Page 23: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

23

Page 24: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

24

Exercise

This exercise reinforces the concepts discussed previously.

Page 25: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

25

Page 26: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

26

Chapter 6: Using Prompts in Tasks and Queries

6.1 Prompting in Projects

6.2 Creating and Using Prompts in Tasks

6.3 Creating and Using Prompts in Queries6.3 Creating and Using Prompts in Queries

Page 27: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

27

Objectives List prompt types that can be used in query filters. Retrieve prompt values from a data source. Use prompts in a query.

Page 28: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

28

Business ScenarioSuppliers frequently request a summary of the orders placed on their products. Rather than creating a task or report for each supplier, the supplier services representative at Orion would like to be able to create a report by choosing a particular supplier at run time.

Page 29: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

29

Using a Prompt: Text, Numeric, Date TypesText, numeric, and date type prompts can be used in the Query Builder to filter data.

Page 30: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

30

Creating a Prompt in the Query BuilderYou can create prompts by accessing the Prompt Manager directly in the Query Builder.

Page 31: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

31

Creating a Prompt for a QueryText, numeric, date, and time prompt types can be used to enable the selection of values to be used in a filter.

Select Get Values… to load data values from an existing data source into the prompt list.

Page 32: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

32

Prompting in Queries

This demonstration illustrates how to create a prompt for use in a query.

Page 33: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

33

Page 34: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

34

Exercise

This exercise reinforces the concepts discussed previously.

Page 35: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

35

Page 36: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

36

Chapter Review1. Is a prompt only available in the project where

it is defined?

 

2. How do you access the Prompt Manager?

Page 37: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

37

Chapter Review Answers1. Is a prompt only available in the project where

it is defined?

Yes

 

2. How do you access the Prompt Manager?

The Prompt Manager can be accessed from the Resources pane in the lower left corner or in the Query Builder.

Page 38: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

38

Chapter Review3. Name the different types of prompts that can

be created.

4. After you create a prompt, what must be done to have the prompt appear?

Page 39: 1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.

39

Chapter Review Answers3. Name the different types of prompts that can

be created.

4. After you create a prompt, what must be done to have the prompt appear?

Prompt types include variable, text, numeric, and date.

The prompt must be used in a task or query, either by assigning it to a task role or using it in a filter.