COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: fgarav on 21 Jul 2009 03:32:22 AM

Title: Trouble on cast ... need some help
Post by: fgarav on 21 Jul 2009 03:32:22 AM
Hi everybody, hope that someone can help me to understand the way how to solve this problem...
I use the code posted to rappresent number of hour , but this code return a datatype CHAR and i can't use on Report Studio to do some calculation , if i wan use ,suppose that i must convert this on int type ... how i can do that?

if ([Foundation Object View].[trANSACTIONPERMINUTES].[REDHH] <10) then ('0'+ cast([Foundation Object View].[trANSACTIONPERMINUTES].[REDHH];varchar(4))) else
    (cast([Foundation Object View].[trANSACTIONPERMINUTES].[REDHH];varchar(4)))


bye
Title: Re: Trouble on cast ... need some help
Post by: lindero on 21 Jul 2009 07:38:08 AM
It's only an idea but why do you set the formating with a conditional if-clause? it is an integer by nature and you can use in Framework Manager the property "DataFormat" to format the value of this dataItem. if you don't cast it to a character, youu are still able to use it as a part of a calculation.

cheers,
LinderO