cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in rounding off the floting value in the Bex query

Former Member
0 Kudos
1,661

Hi ,

      Actually there is a calculation in my calculated keyfigure Oncost,   like below 

Oncost = 1*(KPI Cost>= 0.9)+0 , Here in the KPI Cost is coming as 0.8996 hence I have to make it rounded of upto three decimal point as  0.900 here  before the above calculation . I have tried to make it by the display menu of the CKF by the decimal point making upto three decimal places , but it is calculating by taking original value of KPI Cost (that is 0.8996 )and showing the out put as 0.900 . So is there any function by which I can make rounded of any floating number to its third decimal point. Like 

if the value is 0.8778 it would be rounded of  to 0.878

if the value is 0.8712 it would be rounded of to 0.871

if the value is 0.8996 it would be rounded of to 0.900

If the value is 1.2597   it would be rounded of to    1.260

If the value is 1.3451  it would be rounded of to 1.345

and this needs to be rounded of before the calculation.

could you please help on this.

Thanks in advance

Shatadru

View Entire Topic
Former Member
0 Kudos

Hi Shatadru,

1. Use KPI Cost as KF and in properties of this KF you can restrict to Number of Decimals under Display menu.

2. hide user KPI Cost

3. use it in your above formula

I hope it will help.

Regards,

Madhu

Former Member
0 Kudos

HI Madhu,

               I have already tried that before posting this issue to SDN. In that case what is happening that it is converted to three decimal places but in time of calculation it is taking the value before rounded of. So my purpose is not solved in that case.

Thnaks & Regards,

Shatadru

nanda_veera
Explorer
0 Kudos

Hello Shatadru,

I am also facing similar kind of issue. The value that I need to round it off contains 6 decimals and need to round it to 2 decimals.

How did you managed to fix your issue?

Thanks you for your help.

Best Regards,

Nanda.

Former Member
0 Kudos

Create a Formula Key Figure (FKF) for KPI Cost (KC) with the Following formula and then use it in Oncost

FKF =( FRAC ( 'KC'*1000 ) < 0.5 ) * FLOOR ( 'KC' * 1000 ) / 1000 + ( FRAC ( 'KC' * 1000 ) >= 0.5 ) * CEIL ('KC' * 1000) / 1000

Oncost = 1*(FKF>= 0.9)+0

nanda_veera
Explorer
0 Kudos

Thank you for the quick reply Rakesh....Can you help me to understand what the second statement will do.

Let us take a value 1.444445. As per the above logic

FKF = 0.444

What will be value of 'Oncost' as per the second statement?

My expected value is 1.45.

Former Member
0 Kudos

The Value for FKF will be 1.444 not 0.444.

The calculation that I posted was based on the scenario mentioned in the first post...In that case Onsost will be 1

If you need rounded it to 2 decimals then you need the following formula.

FKF =( FRAC ( 'KC'*100 ) < 0.5 ) * FLOOR ( 'KC' * 100 ) / 100 + ( FRAC ( 'KC' * 100 ) >= 0.5 ) * CEIL ('KC' * 100) / 100