COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Framework Manager => Topic started by: shark1986 on 25 Apr 2022 11:39:14 AM

Title: converting integers to string in framework manager
Post by: shark1986 on 25 Apr 2022 11:39:14 AM
Hi guys, I need some help.
I'm creating a new "month name" field in Framework Manager from the existing month field.
For that I'm doing it like this:

CASE
WHEN MONTH(CREATIONDATE) = 1 THEN '01-JANUARY'
WHEN MONTH(CREATIONDATE) = 2 THEN '02-FEBRUARY' and so on.

But it's giving an error on the dashboard, asking to convert from integer to string, what's the best way to do it?
By Framework Manager it is not possible to change.
Title: Re: converting integers to string in framework manager
Post by: bus_pass_man on 25 Apr 2022 06:44:08 PM
That expression works for me.  I tried it in FM, published a package with it as an query item added to a query subject and added that query item to a widget, and also created a calculation in the dashboard with the expression.  It worked in all cases.   The data type of Date is date time but that shouldn't matter as the returned value of the month function is an integer. 

CASE
WHEN month  ([Business view].[Time].[Date]  ) = 1 THEN '01-JANUARY'
WHEN month  ([Business view].[Time].[Date]  )= 2 THEN '02-FEBRUARY'
end


Can you elaborate what you mean by " it's giving an error on the dashboard" and "asking to convert from integer to string".