Hello. I am a new Cognos user and I am having trouble finding syntax requirements when using CAST to convert a value to a number. In the code below, the value is lborres and it is stored as text (because it is a tall/skinny relational table that has text and numeric values). The value I want is also a number with one decimal place. I have tried using integer, which obviously doesn't work, and I've tried decimal, real, and numeric. I don't think I know the correct parameters to include. Here is my sample code:
cast (case when [C].[FAST].[lbx_34276].[test]='Hemoglobin A1c' then [C].[FAST].[lbx_34276].[lborres] else null end, decimal(??))
The ?? is where I am stumped, I think. The typical values are in the format X.Y or sometimes 1X.Y (e.g., 7.4 or 10.2).
Any help pointing me where to find syntax when using CAST, particularly for numeric values and/or a solution to the problem above would be appreciated.
Thank you.
------------------------------
David Provenghi
------------------------------
#CognosAnalyticswithWatson