COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: TheSun on 04 Feb 2018 09:21:35 PM

Title: Datetime convertion problem
Post by: TheSun on 04 Feb 2018 09:21:35 PM
Hi All

I am facing some problem when trying to create a new date field with current_date. The output I get is in [Feb 5, 2018] format and I need to convert it into different kinds of formats. However when I use function like year(),month(),To_date(), it returns to the error XQE-PLN-0098. I notice that these functions are not supported in my DQM model so here comes to two questions.

First, I get the above error when creating a new query subject in relation layer or a new dimension in dimension layer. But when I use these functions in the filter I create, it works perfectly.
Here is what I do with my filter:
month(CRD) = month(_add_months(current_date, -1))
Am I doing something wrong resulting in the error or its the normal case?

Second, if I cannot use those vendor specified functions, can anyone suggest ways to convert the date form into different format like timestamp.
I was trying to use To_timestamp(year(current_date),month(current_date),day(current_date)) to case it into '2010-04-27 00:00:00.000' form.

Thanks for all your time.
Title: Re: Datetime convertion problem
Post by: bus_pass_man on 06 Feb 2018 05:59:10 PM
I have not memorized error messages and I don't think there is a table of them available.  Usually error messages have text after the number.  There is the possibility that the text can give us a clue about what is wrong.  What is the text that you are seeing?  What is being logged in the xqe log files?

I tried this expression in a filter and it correctly filtered the query subject (in this case returned only those rows where the month in record start date was a January)  Mind you, I was using a DB2 data base.

month ([Business view].[Employee by manager].[Record start date]  )
=
month (_add_months (  current_date ,  -1  ))

Title: Re: Datetime convertion problem
Post by: sdf on 06 Feb 2018 07:52:46 PM
first what DB is your source.
Second, have you tried current_timestamp?
Title: Re: Datetime convertion problem
Post by: bus_pass_man on 16 Feb 2018 08:17:17 AM
Quotewhat DB is your source.
QuoteMind you, I was using a DB2 data base.

Quotehave you tried current_timestamp?
Not current_timestamp.  current_date yes, just now.  I don't know about to_timestamp.  I used _make_timestamp.  It worked except for an annoyingly unclear error, with the spelling error just to make it more aggravating,  in the expression editor.  More importantly, though, it works at runtime.

XQE-MD-0007 Unable to establish a metadata connection to data source ~~/package[@name='frameworkManagerWorkingArea']/model[@name='20180213100239460']:
MFW-UT-1002 An internal problem has occurred. Please contact your system administrator.
MFW-UT-1003 Details: "Expecting at least a namesapce when looking up this ID in advanced lookup Year"


QuoteI have not memorized error messages and I don't think there is a table of them available.  Usually error messages have text after the number.  There is the possibility that the text can give us a clue about what is wrong.  What is the text that you are seeing?  What is being logged in the xqe log files?