If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Trucate a number

Started by jjacob, 17 Oct 2016 05:07:52 PM

Previous topic - Next topic

jjacob

I need to show a number as a whole without rounding it.  Changing the decimal setting to "0" performs rounding.  I've attempted to use function TRUNC with no success.

Ideas/Suggestions?

BigChris

You could try casting it as an integer, or use the Int function.

Lynn

Or maybe the floor function.

jjacob

I did get this to work late yesterday by casting as an integer.  Thanks for the help!

MFGF

Quote from: jjacob on 18 Oct 2016 03:56:45 PM
I did get this to work late yesterday by casting as an integer.  Thanks for the help!

I'd expect Lynn's floor() function suggestion would be a more efficient solution than using a cast() function?

Cheers!

MF.
Meep!

AnalyticsWithJay

Quote from: MFGF on 19 Oct 2016 05:44:01 AM
I'd expect Lynn's floor() function suggestion would be a more efficient solution than using a cast() function?

Cheers!

MF.

I agree with MF's statement. Be careful with using Cognos' cast() function because it's a locally processed function. It will not be as efficient as floor(), which is sent to the DB for processing.