COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: asmfloyd on 23 Aug 2019 04:45:31 AM

Title: Defaulting number value with a string
Post by: asmfloyd on 23 Aug 2019 04:45:31 AM
Hi,
  I have a number field X with a thousand separator as comma. I have a condition that if value of a FLAG column is "Y", I need to default  the number value as "#". So I am doing the below conversion. But when converted, it is removing the thousand separator from other values (Ex: 123,456 becomes 123456) .
   How can I default this keeping the thousand separators in place?

IF (FLAG='Y') then (to_char(X)) else ('#')
Thanks,