Author Topic: Framework Manager - Number of Decimals  (Read 383 times)

Offline CognosUser222

  • Full Member
  • ***
  • Join Date: Oct 2020
  • Posts: 5
  • Forum Citizenship: +0/-0
Framework Manager - Number of Decimals
« on: 06 Nov 2020 03:18:28 am »
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

Offline bus_pass_man

  • Statesman
  • ******
  • Join Date: May 2008
  • Posts: 446
  • Forum Citizenship: +43/-0
Re: Framework Manager - Number of Decimals
« Reply #1 on: 06 Nov 2020 05:40:06 am »
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.

Offline CognosUser222

  • Full Member
  • ***
  • Join Date: Oct 2020
  • Posts: 5
  • Forum Citizenship: +0/-0
Re: Framework Manager - Number of Decimals
« Reply #2 on: 06 Nov 2020 06:32:31 am »
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!