简体   繁体   中英

SSRS Expression Issue,problems with a ) or a ,

My SQL Statement:

=IIF
(
  IIF(
   SUM(Fields!EstUnits.Value) <= 0,
   0,
   Sum(Fields!JTDUnits.Value) / 
   IIF
   (
     Sum(Fields!EstUnits.Value)=0,
     1, 
     Sum(Fields!EstUnits.Value)
   )
  )<=0,
  Sum(Fields!PeriodCost.Value) + Sum(Fields!EstCost.Value),
  IIF
  (
    IIF
    (
      SUM(Fields!EstUnits.Value) <= 0,
      0,
      Sum(Fields!JTDUnits.Value) / 
      IIF
      (
        Sum(Fields!EstUnits.Value)=0,1,Sum(Fields!EstUnits.Value)
      )
    )>0.25,
    Sum(Fields!JTDCost.Value)/ Sum(Fields!EstCost.Value),
    Sum(Fields!EstCost.Value)
  )
)

Getting error message:

Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

I know its a ) or , but I have been trying to get this right for hours and I would love some extra eyes on this. The statement should be evaluating if % is <= zero, than add two columns together, else if % is more than 25%, than divide column by %, else = column

When I dissolve the expression it comes to this (I replaced a value always with 4 and a condition with b ):

=IIF(4)<=0,4,4)

You have to check yourself, because I dont really know how to correct this expression based on your outcome:

=IIF(
  IIF(
      b,
      0,
      4 / IIF(b,1, 4)
      ) <=0,
          4,
  IIF(
   IIF(
       b,
       0,
       4 / IIF(b,1,4)
       ) >0.25,
             4,
             4
     )
    ) 

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