If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Prompt in Framework Manager

Started by Lee Drake, 08 Apr 2008 04:06:56 PM

Previous topic - Next topic

Lee Drake

I am working on my first Cognos Model (I worked with BO until recently).  I am having some trouble with it.

The current issue I am having is that I need to create a prompt in FM.  The ultimate goal is a date condition object that defaults to yesterday.

I found a related posting on the Cognos site.  It said to create a filter on the query subject with the condition
#prompt( 'Desired Date', 'date', '_last_of_month (_add_months (current_date,-1))')#
This is supposed to put a prompt on date that defaults to the end of the previous month.  I can not get this to work.  The prompt always defaults to current date.

I believe that if I can get this to work, I can modify it to my needs.  Please tell me what I am doing wrong or if I am headed down the wrong path altogether.

blom0344

#1
If you test this in FM, then it will return the testvalue. After one test it will use cache for further testing.
(which will return the current date if that is the first value tested).
To avoid the cache, close and open FM (or clear the prompt value through the options button in the calculations GUI)

Lee Drake

That is correct.  Unfortunately, that is not what I am asking.

Let me clarify.  The code I am using is supposed default to last day of the previous month.  It always defaults to the current day.  This occurs in FM and in a report.

I have tried many variations, and it always defaults to the current date.  I am assuming that this means it is not recognizing that it has a default and the "default" default for a date prompt is current day.  How do I get it to pick up the default value I am trying to calculate?

If I can get this to work, I am confident I can modify it to what I really need.

blom0344

Sorry for misreading your request.
I wonder if this isn't just a sort of bug. I recall that adding default values from within Report Studio to list-based prompts resulting in the prompt being skipped altogether.

Lynn

You might need to use native database date functions. So in Oracle for example, to default to yesterday it might be something like:
#prompt('Desired Date','Date','sysdate-1')#

Look at the generated SQL for the query subject and try to run the native version directly against the database (Toad or something). That might help you troubleshoot.