can Anyone help me, how to change method dimension date categories with date value ??
I have cognos script below
Set objPPRep = CreateObject("CognosPowerPlay.Report") _
objPPRep.Open( "D:\data\consumer.ppx" )
objPPRep.DimensionLine.Item("Products").Change("Microwave")
objPPRep.SaveAs "D:\Data\Consumer_Alltables.asc",3
Set objPPRep = Nothing
End Sub
then, i add script to change method dimension date categories with date value
objPPRep.DimensionLine.Item("dates").Change("2012/04/30")
or
objPPRep.DimensionLine.Item("dates").Change("Current day")
But this scripts doesn't work, can anyone help ??
This line:
objPPRep.DimensionLine.Item("dates").Change("2012/04/30")
should work ok.
Reasons why it may not work:
1) 'dates' is not the name of the dimension
2) '2012/04/30' is not a category in the dimension
3) '2012/04/30' does exist as a category, but not in a level below where you're currently looking at the cube. For example, if the levels in the dates dimension are (calendar) year-month-date then it'll only work if it's currently looking at a year 2012 or month 04. If it's currently looking at May, it won't be able to change to the requested date. If it's looking at another date in April, again, it won't be able to change to the specified date. If this is the problem, try using the 'ChangeToTop' method prior to your change. i.e.
objPPRep.DimensionLine.Item("dates").ChangeToTop
objPPRep.DimensionLine.Item("dates").Change("2012/04/30")