0% found this document useful (0 votes)
19 views6 pages

Cognos - Setting Dynamic Default Date Prompts

The document provides a guide on setting dynamic default date prompts in IBM Cognos Report Studio, allowing users to easily run reports for the previous month while still having the flexibility to adjust for other periods. It outlines the steps to create a query for default dates and set up both hidden and visible prompt pages. The process enables users to pass date values into their main report queries seamlessly.

Uploaded by

leonardo.russo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views6 pages

Cognos - Setting Dynamic Default Date Prompts

The document provides a guide on setting dynamic default date prompts in IBM Cognos Report Studio, allowing users to easily run reports for the previous month while still having the flexibility to adjust for other periods. It outlines the steps to create a query for default dates and set up both hidden and visible prompt pages. The process enables users to pass date values into their main report queries seamlessly.

Uploaded by

leonardo.russo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Cognos: Setting dynamic

default date prompts


IBM Cognos Analytics, Tech Tips

26 April, 2012 QMetrix

Home | IBM Cognos Analytics | Cognos: Setting dynamic default date prompts

In IBM Cognos Report Studio you can set default values in your QMetrix
prompts, however these are not dynamic. So when you have reports
that you want to mostly run for the previous month period, but then
from time to time you may want to run it for other periods, you would
have to do this in two separate reports or not have default dates set Quick Links
at all.

Improving the health and wellbeing of


Here is a way for you to have both.
the budgeting and planning process

Profisee releases – what’s new


Default Date Query
Financial management and corporate
planning for not-for-profits
Create a new report in Report Studio and create a Query called
‘p_DefaultDates’. The ‘p_’ stands for prompt. Note: For my example I Workday Adaptive Planning (Adaptive
am using a SQL Server database so the functions below may need to Insights) releases – what’s new
be adjusted according to your data source.
Introduction to Dashboards in Workday
Within this Query create three Data Items called: Adaptive Planning / Adaptive Insights

Current Date

First of Month   
Last of Month

Within these Data Items type in the following:


Current Date current_date
First of Month _first_of_month ( [Last of Month] )
Last of Month _last_of_month ( _add_months ([Current Date], -1 ) )

When you run this in View Tabular Data you will get the following:

Hidden Prompt Page

Then create a Prompt Page called ‘Prompt Page Hidden’. Within the
prompt page drag in a table 1 column, 2 rows, two HTML Items and
two Value Prompts and arrange them as follows:

Within the first HTML Item type in the following:

function setPrompts()
{
f = getFormWarpRequest();
f.getElementsByTagName(“select”)[0][2].selected = true;
f.getElementsByTagName(“select”)[1][2].selected = true;
setTimeout(“promptButtonNext();”, 300);
}

setPrompts();

Within the first Value Prompt set as per the following:

With the second Value Prmpt set as per the following:


Visible Prompt Page

Now create a prompt page that you will see. On this page add a table
consisting of 2 columns and 2 rows, 2 text items and 2 date prompts
and arrange them as follows:

Within the first Date Prompt (Date From) set as per the following:

Within the second Date Prompt (Date To) set as per the following:

Run the Report


Now when you run your report, you will see the Visible Prompt Page
with the start and end date prompts being the first and last days of
the previous month.

You then just pass these values into the main query within your report
as you normally would.

Adjusting for other Periods

Adjusting for other periods is very easy; just by change what is in the
p_Default_Dates Query.

Looking for more Cognos Analytics tips?

How to create a report in Cognos with frozen panes

Solves issues exporting from Excel to Internet Explorer with


Cognos

How to use the “Solve Order” feature in Cognos Report Studio

IBM Cognos Analytics releases – what’s new with each version

Get more tips and news on Cognos here

Related Articles


Improving the health and wellbeing of the Profisee releases – what’s new
budgeting and planning process Get the latest updates on this Master Data Management tool. Our
Royal Australian College of General Practitioners moved to a consultants share the highlights of each new release of Profisee.
leading cloud-based budgeting and planning solution and received
enormous benefits.

Financial management and corporate planning


for not-for-profits
No matter how well thought-out your business strategy is, plans
change. Is your FP&A equipped to be part of the strategy
conversation?

Stay in touch  

Get the latest insights from QMetrix straight in you inbox.

Consulting Technology footer logo


How we work
Get the latest insights and
Budgeting and Planning Adaptive Insights news from QMetrix
Let's chat
Master Data Management Profisee
First Name:
Business Intelligence Microsoft Power BI
Last Name:
Forms and Workflow IBM Cognos Analytics
Automation
Frevvo

Email:
- Please Select -

Keep me updated

© 2021 QMetrix Pty Ltd All rights reserved. | Privacy Policy | Terms and Conditions | Sitemap | 1300 785 336

You might also like