Active IQ Unified Manager Discussions

DWH report with date prompt

pfrenard
3,072 Views

Hi all,

 

I m trying to build a report with a date prompt feature.

 

my sql table is something like that

 

id,object,kpi1,kpi2,kpi3,date

 

for each date, I have for each object a list of kpi

a select object,date from table can give that

 

storage1,date1

storage2,date1

storage1,date2

storage2,date2

 

storage1,date3

storage2,date3

storage1,date4

storage2,date4

 

I 'd like to have by default the report to use the latest date ( max(date) ) and the ability to use the dateprompt to select on specific date.

 

I guess I have to use a parameter to the query, and set this parameter at the latest date by default ...

but I don't know how.

 

 

Thanks a lot for your help

Fox

 

 

2 REPLIES 2

hoffman
3,024 Views

Dynamic date prompts in Cognos are not as straightforward as one might hope. IBM has a developer proven practices article that goes through how to use JavaScript to achieve something similar to what you're trying to achieve: http://www.ibm.com/developerworks/library/ba-pp-reporting-scripting_techniques-page634/

 

I haven't tried it myself, but hopefully it gets you on your way.

 

-Bryan

moechnig
2,939 Views

Sorry for the late reply. 

 

This turns out to be a bit of a big question.  I will try to steer you toward breaking it into some pieces. 

 

I would create a query just to collect the latest date in the part of the DWH you're using.  Note that in dwh_performance, this will probably be one day earlier than in dwh_capacity so you will want to verify that the date that comes back does have the data you need.  Because I habitually use SQL, I'd do something like "select max(fulldate) from date_dimension where latest=1". 

 

Once you have that query, you can use its output as the default value in your date prompt. 

 

The other reply will provide some guidance on how to get the prompt put together.  That's a bit of a process.  Haven't used that how-to myself.  Googling around for date prompt in Cognos should help.  If you can get Cognos to understand that your'e prompting for a date, it should provide  a calendar interface for the selection. 

 

Good luck. 

Public