Cognos - Setting Dynamic Default Date Prompts
Cognos - Setting Dynamic Default Date Prompts
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.
Current Date
First of Month
Last of Month
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:
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:
function setPrompts()
{
f = getFormWarpRequest();
f.getElementsByTagName(“select”)[0][2].selected = true;
f.getElementsByTagName(“select”)[1][2].selected = true;
setTimeout(“promptButtonNext();”, 300);
}
setPrompts();
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:
You then just pass these values into the main query within your report
as you normally would.
Adjusting for other periods is very easy; just by change what is in the
p_Default_Dates Query.
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.
Stay in touch
Keep me updated
© 2021 QMetrix Pty Ltd All rights reserved. | Privacy Policy | Terms and Conditions | Sitemap | 1300 785 336