简体   繁体   中英

Using Round/Ceiling/Floor function with IIF in SSRS expression

In my, SSRS report the values for Success and Fail fields are supposed to together add up to 100. But as seen below the sum of the Success and Fail fields is falling short of 100 due to some round-off error. 图片

I have used this expression to show the result for Success .

    =IIF(Fields!CountNearlyAlwaysOnSuccess.Value +Fields!CountNearlyAlwaysOnFail.Value =0, 
    100,Fields!NearlyAlways_On_SLO_Success.Value) & "%," & Fields!CountNearlyAlwaysOnSuccess.Value

The expression for Fail is below.

    =(Fields!NearlyAlways_On_SLO_Fail.Value) & "%," & Fields!CountNearlyAlwaysOnFail.Value

I have tried the following approaches to no avail.

  1. From text box properties, try to set the value of percentage decimal points to 2.

  2. Adding the Round/Ceiling/Floor function to the value of Fields!NearlyAlways_On_SLO_Success.Value .

Any help is truly appreciated.

Because Success and Fail must necessarily partition the data, try displaying the FAIL percent as the remainder from the SUCCESS percent

= IIF(Fields!CountNearlyAlwaysOnSuccess.Value 
   + Fields!CountNearlyAlwaysOnFail.Value = 0
   , 0, 100 - Fields!NearlyAlways_On_SLO_Success.Value
  ) & "%," & Fields!CountNearlyAlwaysOnFail.Value

If that doesn't work, you can try adjusting how you calculate NearlyAlways_On_SLO_Fail , but try this first and report back

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM