COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: naqsa on 28 Jul 2015 01:21:12 PM

Title: How to remove comma in report field
Post by: naqsa on 28 Jul 2015 01:21:12 PM
Hi All,
I'm using Cognos in my expense system, Concur (report studio). I'm using the following statements to tie card numbers with employee location.

case
when([Expense].[Employee Information].[Org Unit 1 - Name] = 'ABC') then (12345)
when([Expense].[Employee Information].[Org Unit 1 - Name] = 'DEF') then (6789)
when([Expense].[Employee Information].[Org Unit 1 - Name] = 'XYZ') then (4567)
else (0) end

When I run the report the data is displayed as '12,345' '6,789'...
How can I format the field to display the data without commas?

Thanks
Title: Re: How to remove comma in report field
Post by: NIEK87 on 28 Jul 2015 01:56:12 PM
Title: Re: How to remove comma in report field
Post by: naqsa on 28 Jul 2015 02:12:35 PM
Hi, thanks for responding.

I' played around with that earlier and din't see 'number' as a Format Type.  I see Default and Text.
Title: Re: How to remove comma in report field
Post by: NIEK87 on 29 Jul 2015 12:56:06 AM
You don't see the option 'number' as a Format Type? That is strange. What kind of object have you placed the data item in? Is it a list?

Another option that you can try is: Data (in the top menu) > Default Data Formats.

Title: Re: How to remove comma in report field
Post by: TheFrenchGuy on 29 Jul 2015 03:40:01 AM
Hello,


Have you tried to make your output expression in string, like :
case
when([Expense].[Employee Information].[Org Unit 1 - Name] = 'ABC') then ('12345')
when([Expense].[Employee Information].[Org Unit 1 - Name] = 'DEF') then ('6789')
when([Expense].[Employee Information].[Org Unit 1 - Name] = 'XYZ') then ('4567')
else (0) end
Title: Re: How to remove comma in report field
Post by: naqsa on 29 Jul 2015 10:20:57 AM
Hi FrenchGuy,

I've tried that and get this error: QE-DEF-0405 Incompatible data types in case statement.
Title: Re: How to remove comma in report field
Post by: NIEK87 on 29 Jul 2015 12:20:31 PM
Change the else (0) to Else ('0').

That way all the possible results are a string.
Title: Re: How to remove comma in report field
Post by: naqsa on 29 Jul 2015 12:31:39 PM
Thanks NIEK87 and FrenchGuy.

Here's what worked: combined both NIEK And FrencGuy's suggestion.

Thanks again for all your help.  :D
Title: Re: How to remove comma in report field
Post by: TheFrenchGuy on 30 Jul 2015 07:29:19 AM
Teamplay Overpowered  8)