COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: en1 on 10 Nov 2014 06:23:43 AM

Title: help
Post by: en1 on 10 Nov 2014 06:23:43 AM
Hi!
Problem: two date prompt  with names date_from and date_to.
When user change value in  date_from value in date_to set automaticaly and equal date_from - 1year

first i try filters and find that function filter() not work with _add_years. because of this now i try JavaScript.
Its Ok. i write function that set value to date_from prompt.  But where i can place call of this function? 
in official doc: if i want to place call of this function on Finish button i must delete Finish button? peplace it by html button with onclick = my function.
in this case Finish lose its functionality (validation) an it is bad way.

Title: Re: help
Post by: Lynn on 10 Nov 2014 06:52:49 AM
Is your package dimensional or relational?
Title: Re: help
Post by: en1 on 10 Nov 2014 08:29:56 AM
dimensional
Title: Re: help
Post by: Lynn on 10 Nov 2014 09:15:23 AM
The _add_years function is something that makes sense in a relational situation. Your dates in a dimensional source are really members rather than actual dates. I don't think date range prompts are the right concept in a dimensional model. Wouldn't the user instead choose from a values in a level or perhaps in a tree prompt?

In a dimensional scenario I think you'd be using parallel periods function or something along those lines to use one date member to find a different one elsewhere in the hierarchy. What is the structure of your time dimension?

Title: Re: help
Post by: en1 on 10 Nov 2014 10:11:51 AM
Ok.  :) in short i need call JavaScript function when user click Finish button. How can i do this on Finish button without replace it?
Title: Re: help
Post by: Lynn on 10 Nov 2014 10:25:13 AM
Quote from: en1 on 10 Nov 2014 10:11:51 AM
Ok.  :) in short i need call JavaScript function when user click Finish button. How can i do this on Finish button without replace it?

I don't use JavaScript and I'm not really sure how that helps you anyway.