COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: FIR1987 on 18 Nov 2010 11:23:15 PM

Title: The default date in my date prompt doesn’t filter my list when I run the report
Post by: FIR1987 on 18 Nov 2010 11:23:15 PM
1I have created a date prompt form my list in Report Studio ,and then drag a html  object near the date prompt within the code below

function subtractDay ()
{
var dtToday = new Date();
var dtYesterday = new Date( dtToday - 86400000 );
var strYesterday = [dtYesterday.getUTCFullYear(), dtYesterday.getMonth()+1, dtYesterday.getDate()].join("-");
Return strYesterday;
}
pickerControlPDate.setValue( subtractDay() );//PDate为date prompt name
</script>
2I also add the filter [renewPolicyQuery].[Time].[Time].[Day].[Day - fullname] = ?day?
3I drag [renewPolicyQuery].[Time].[Time].[Day].[Day - fullname] and another measure to the list

When I run the report .My date prompt has changed to the first day in current month,but the data in my list  still show all data in every day


The report is shown as below
Date prompt : 2011-5-1   

//the js make the date change to the first day of currentmonth,but    the list was doesn't changed by the filter.Every time ,I have to click the button finish to let the list change

List
Date          company  measure
2011-5-18   110                500 
2011-5-18   192                300
2011-5-18   111                500
2011-5-18   112                200  



Can I change my list to the default date (the first day in current month) which shown in my date prompt  
Title: Re: The default date in my date prompt doesn’t filter my list when I run the report
Post by: MFGF on 19 Nov 2010 03:47:16 AM
If you select your date prompt and look at it's properties on the left, what parameter name is listed in the 'Parameter' property?

MF.
Title: Re: The default date in my date prompt doesn’t filter my list when I run the report
Post by: FIR1987 on 21 Nov 2010 12:42:35 AM
the parameter name is day
Title: Re: The default date in my date prompt doesn’t filter my list when I run the report
Post by: MFGF on 22 Nov 2010 03:49:25 AM
If you look at the filters attached to your list query, do you have just one filter using the ?day? parameter or two?  Are they (it) set to optional or required?

MF.
Title: Re: The default date in my date prompt doesn’t filter my list when I run the report
Post by: FIR1987 on 22 Nov 2010 09:40:49 PM
Thanks .I have only one filter ,and it is optional
Title: Re: The default date in my date prompt doesn’t filter my list when I run the report
Post by: FIR1987 on 09 Dec 2010 03:17:56 AM
Anyone  has solution to this problem , thanks
Title: Re: The default date in my date prompt doesn’t filter my list when I run the report
Post by: FIR1987 on 18 May 2011 10:21:59 AM
I haven't solved it  yet.Could you help me on this problem . :)
The data source  is cube.


The report is shown as below

Date prompt : 2011-5-1 

//the js make the date change to the first day of currentmonth,but    the list was doesn't changed by the filter

List

Date          company  measure
2011-5-18   110                500 
2011-5-18   192                300
2011-5-18   111                500
2011-5-18   112                200