Rounding Based on Value (10ths/100ths/1000ths)

  • Hi,

    I have a textbox which is populated along the lines

    =MAX(Fields!Sales.Value, "lbDataSet")

    What I want to do, is depending on the value in that box round it up to either,

    the nearest tenth if it is less than 10,

    the nearest 100th if it is greater than 10

    the nearest 1000th if it is greater than a 100

    the nearest 10,0000th if it is great than a 1000

    and so on

    The ceiling function, does not work in reporting services as i expected, nor does the round. the only way I can think of doing this is with several if statements, which can't be that efficent.

  • Kind of got a solution which is not quite what I wanted, but will do.

    I have a textbox called txtMaxSales and in it, I have the following expression

    =(math.Max(MAX(Fields!Sales.Value, "Data_lbPlanResult"),MAX(Fields!CompSales.Value, "Data_lbPlanResult")))*1.05

    I then have a second textbox, refering to txtMaxSales

    =LEFT(format(reportitems!txtMaxSales.value,"0.00E+00"),4)*10^RIGHT(format(reportitems!txtMaxSales.value,"0.00E+00"),3)

    Then using the result of this for the Max of my chart axis. The above is effectively formating it to 3 significant figures , which makes the charts a bit more readable

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply