Documente Academic
Documente Profesional
Documente Cultură
IBM, the IBM logo, and Cognos are trademarks or registered trademarks of
International Business Machines Corp., registered in many jurisdictions worldwide.
Other product and service names might be trademarks of IBM or other companies. A
current list of IBM trademarks is available on the Web at
http://www.ibm.com/legal/copytrade.shtml
While every attempt has been made to ensure that the information in this document
is accurate and complete, some typographical errors or technical inaccuracies may
exist. IBM does not accept responsibility for any kind of loss resulting from the use of
information contained in this document. The information contained in this document
is subject to change without notice.
This document is maintained by the Best Practices, Product and Technology team.
You can send comments, suggestions, and additions to cscogpp@ca.ibm.com.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft
Corporation in the United States, other countries, or both.
.
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 3
Dates within IBM Cognos Report Studio
Contents
1 INTRODUCTION..............................................................................................4
1.1 PURPOSE..................................................................................................................4
1.2 APPLICABILITY.............................................................................................................4
1.3 ASSUMPTIONS.............................................................................................................4
1.4 CAVEATS AND EXCEPTIONS...............................................................................................4
2 CREATING THE IBM COGNOS REPORT STUDIO REPORT...............................5
2.1 BUILDING THE LIST......................................................................................................5
2.2 CREATING THE VALUE PROMPT..........................................................................................6
2.3 CREATING THE FILTER CONDITION......................................................................................7
2.4 SCHEDULING THE REPORTS..............................................................................................9
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 4
Dates within IBM Cognos Report Studio
1 Introduction
1.1 Purpose
This document describes an approach to present a ‘relative date’ to a report
consumer within a prompt or set of prompts. Many organizations might need
relative date’s activity such as the activity in the last 7 days, Month to date,
Year to Date.
1.2 Applicability
The techniques outlined in this document were validated against the GO Data
Warehouse (query) package shipped with the samples for the following
releases:
• IBM Cognos 8.4
• IBM Cognos 8.4.1
• IBM Cognos 10.1
1.3 Assumptions
This document assumes that its reader has an understanding of the IBM
Cognos Report Studio functionality and therefore will not provide the
individual steps required for basics tasks.
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 5
Dates within IBM Cognos Report Studio
The following sections step a user through the creation of the simple list, the
parameter with static values, the filter object and the conditional formatting.
Figure 1 IBM Cognos Report Studio displaying a list report with the aforementioned
query items.
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 6
Dates within IBM Cognos Report Studio
Figure 2 IBM Cognos Report Studio with the Prompt Wizard- Value Prompt dialog box
displaying the new parameter name as Relative Date.
Use Display
7d Last 7 days
MTD Month to Date
YTD Year to Date
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 7
Dates within IBM Cognos Report Studio
When completed the Static Choices dialog box should represent the following
screen capture.
Figure 3 IBM Cognos Report Studio Static Choices dialog box displaying the Last 7
days, Month to Date and Year to Date static choices.
2. Change the Auto-Submit property of the prompt from No to Yes. This will
submit the prompt automatically every time the value prompt is changed.
3. Change the Required property of the prompt from Yes to No.
end
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 8
Dates within IBM Cognos Report Studio
In order to make this filter condition dynamic the hard coded date of 2007-
05-17 could be replaced with a vendor specific time function which retrieves
the current date at the time of execution.
Figure 4 IBM Cognos Report Studio detail filter dialog box displaying the case when
filter definition.
2. Change the Usage property on the detail filter from Required to Optional.
3. If the report is executed at this point it will produce the following output. In
order to prove that the filter is working a layout calculation of
ParamDisplayValue('Relative Date') has been added beside the value prompt.
Figure 5 IBM Cognos Viewer displaying the list output in HTML format for the Last 7
days time period.
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 9
Dates within IBM Cognos Report Studio
If the prompt is changed, the screen automatically refreshes with the data
and the layout calculation reflecting the new time period.
Figure 6 IBM Cognos Viewer displaying the list output in HTML format for the Year to
Date time period after the user changed the prompt value.
In many cases, it is required to have reports that are run and/or distributed
on a schedule. We can leverage the relative date concept for report
scheduling.
Figure 7 IBM Cognos Connection displaying a report view for each of the three
reporting periods.
2. From IBM Cognos Connection, create a new schedule for the Relative Dates
(Last 7 Days). In the schedule, set Frequency to By Week, Every (1) Week on
Monday, and set the Prompt Values to Over ride Default values and when the
report prompts are presented, choose Last 7 Days. Then choose a starting
date.
Business Analytics
Conditional Business Reporting Based On Relative and Absolute 10
Dates within IBM Cognos Report Studio
In this example an IBM Cognos Report Administrator has setup the Last 7
day report that would run every Monday morning.
Figure 8 IBM Cognos Schedule Management displaying a schedule for the Last 7 day
reporting period.
Business Analytics