COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Jeff H. on 17 Nov 2017 12:55:34 PM

Title: 11.0.8 Date functions broken?
Post by: Jeff H. on 17 Nov 2017 12:55:34 PM
Hi all,

Has anyone had issues with the Cognos Report date functions? It looks like they've changed the behaviour of these and I can't get any of them to work.

date2string, string2date, current_date has been renamed to AsOfDate(). I wish they'd document this stuff. I guess that's too much to ask.

I noticed too that the cast function is gone from this release.


Thanks,
Jeff
Title: Re: 11.0.8 Date functions broken?
Post by: rockytopmark on 17 Nov 2017 01:05:15 PM
current_date is still there, and as always, is only available in data item (query) expressions. 
AsOfDate() is available in report expressions only.

date2string() is only a report expression function and is working fine in 11.0.8.

string2date() is only a report expression function and is working fine in 11.0.8.

MK
Title: Re: 11.0.8 Date functions broken?
Post by: Jeff H. on 21 Nov 2017 11:48:22 AM
Thanks! I haven't been doing much FM modelling/report writing lately and forgot which functions work in query subjects vs. report.

We ran into a problem in a report existing report where the report expression was:

_last_of_month(string2timestamp(ParamValue('pDateRange')))

we had to modify it to:

_last_of_month(date2timestamp(string2date(ParamValue('pDateRange'))))


From what we are seeing the string2timestamp is now not accepting the ParamValue because it's actually a date. It appears the function is now strongly typed so it must be a string for the string2timestamp to work. It would be nice if _last_of_month didn't expect a timestamp and could use a date instead.