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

passing values in lastPeriod()

Started by cham, 19 Sep 2011 12:36:41 PM

Previous topic - Next topic

cham

Hello Gurus,

I am facing problem when passing values in lastPeriods(). I want to get the set of months that ends with the Report month choosen by the users. So, I created a data item with expression lastPeriods(7,[ReportMonth]) , which is working fine in my report.

Now I am trying to pass the value instead of hard coding value '7'. So, created a data item which is returning the month number, like for June 2011 the month number will be 6. And I used the expression as lastPeriods([Month NBR),[ReportMonth]). But it is not working. I want to pass the value because this is not constant and dependent on the report month.

I don't know where am I wrong.

Please help me in this regard. it's very urgent requirement.

thank you in advance!!!

kalyanapu

As per my understand,
"lastPeriods " expects only inter value.
Syntax: lastPeriods ( integer_expression , member )
But you are passing the value as String like '7'
That means syntax violation is happening when you are parsing the syntax.
"If you have a month value as String in database, convert into number or integer."
Then it works well.

Best Regards.
Srinivas Kalyanapu

cham

Thanks Srinivas for your reply.

Actually I am passing integer value. Just to check I created a data item with integer constant 7. and I am trying to use that data item in lastPeriods([dataitem],[Report Month]). the result is null.

Any help on this?

cham