You are a report author at The Sample Outdoors
Company, which sells sporting equipment. You are requested to create
a report that shows orders after a date specified by the user. The
report will prompt the user for a date and ask whether the user wants
to see a description for each order.
Procedure
- Open IBM® Cognos® Report Studio with the GO
Data Warehouse (query) package.
- In the Welcome dialog box, click Create
a new report or template.
- In the New dialog box, click List and
click OK.
- From the Source tab , expand Sales and Marketing (query), and Sales (query) and add data items to the list:
- Expand Time dimension and add Date.
- Expand Sales order and add Order number.
- Expand Product and add Product name and Product description.
- Expand Sales fact and add Quantity, Unit price, and Revenue.
- Click Date, and then click the section button .
- Select the Order Number column and click the group button .
- Click Revenue, and then click the summarize button and click Total.
- Change the title of the report to New Orders.
- Pause the pointer over the page explorer button and click Prompt Pages.
- Create a new prompt page by double-clicking Page in the Toolbox tab .
- Double-click the new prompt page.
- From the Toolbox tab, double-click Text
Item and type the following text:
Enter the start date, and select if descriptions will be shown.
- Insert a 2 by 2 table into the prompt page by clicking the insert table button and moving the pointer until four squares are highlighted in a 2 by 2 pattern.
- From the Toolbox tab, drag a Text
Item into the upper-left cell and type the following text:
Starting Date
- From the Toolbox tab, drag a Text
Item into the lower-left cell and type the following text:
Show Descriptions
- From the Toolbox tab, drag a Date
Prompt into the upper-right cell.
- In the Prompt Wizard window, select Create
a new parameter, type p_Date in the space provided,
and then click Next.
- In the Create Filter window, select Create
a parameterized filter with the following entries:
- For Package item, click the ellipsis button and open Sales (query) and Time dimension, and then click Date.
- For Operator, click >.
- Click Finish.
- From the Toolbox tab, drag a Value
Prompt into the lower-right cell.
- In the Prompt Wizard, in the Choose
Parameter window, select Create a new parameter,
type p_ShowDesc in the space provided, and then click Finish.
- Select the Value Prompt and, in
the Properties pane, double-click Static
Choices.
- Click the add button .
- In the Edit dialog box, type Yes in
both the Use and Display boxes.
- Click the add button.
- In the Edit dialog box, type No in
both the Use and Display boxes.
- Click OK.
- Pause the pointer over the condition explorer button and click Variables.
- From the Toolbox tab, create a new
Boolean variable by double-clicking Boolean Variable.
- In the Report Expression dialog
box, type the following in the Expression Definition window
and click OK:
ParamDisplayValue("p_ShowDesc")
= 'Yes'
- In the Properties pane, set the Name property
to showDesc.
- Pause the pointer over the page explorer button and click the report page.
- Click the Product descriptions column.
- In the Properties pane, click the select ancestor button and click List Column.
- In the Properties pane, set the Render
Variable property to the showDesc Boolean
variable you created.
- Run the report.
Results
The report prompts you for a date. Orders that occur after
the date you entered are shown. The report also asks whether to show
the
Descriptions column, and the column is
rendered only if you choose
Yes.