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

Framework Manager - Number of Decimals

Started by CognosUser222, 06 Nov 2020 03:18:28 AM

Previous topic - Next topic

CognosUser222

Hello,
I am using Framework Manager Version 11.0 and I have the following problem:

I have a measure which has as its regular aggregate "Sum". The values it sums are integers, so the sum is also an integer.
Now, I have as "aggregation rule" "Average". That is, in reports where I look at months, I have sums and when I look at years, I have the average of the month values.

I want to do the following: If my measure is an integer, I want to have it no decimal numbers (i.e. no 5.00 but 5). If it is not an integer, I want to have it at most 2 decimal numbers (so 5.54 instead of 5.546666).
Now, how can I do this? I found under "Format" the option "Number of decimals". But if I use "2" here, every number will have two decimals, even the integers.

I hope you can help me here.

Thank you very much for any answers:)

Best,
CognosUser222

bus_pass_man

You could try _round.  It would allow for whole numbers to be rendered without decimals and for other numbers to be rendered with just the number of decimal places you want.

The tradeoff would be that if the value was less than the number of decimal points specified it will not pad out to that.

For example in your case, since you want the values to 2 decimal places, a value which is only one decimal place, such as 1.5 would not display as 1.50 but as 1.5.

CognosUser222

Hello bus_pass_man and thank you for your answer!

I thought about using _round, but I am not sure where I should put it.
It cannot work if I put it into the definition of my measure (_round(
.[Value] instead of
.[Value]), right? Because then the numbers get rounded before I even take the sum (and they are integers), i.e. if my values are 1 and 2, I would round them to still have 1 and 2 and after that I would take the sum and than I avarage.

Or is there any other place where I can put formulas?

(Your tradeoff would not be a problem for me, but precisely what I want.)

Thank you again for the reply!