Filter in report

sharon95sharon95 Member Posts: 183
I would like to write a code like this in a report

=iif(Int(Filter(Fields!SJ_Amount.Value,"0")) > 1, "# " + Last(Fields!TotAmount.Value), Last(Fields!TotAmount.Value)

I want to set a filter in the Amount rows, if it exists at least one row with the amount equal to 0 then I want to print "# Amount", else "Amout"
it prints "#Error"... Help meeeee! thanks!

Best Answer

Answers

  • lubostlubost Member Posts: 623
    You shoud convert bolded value to string:
    =iif(Int(Filter(Fields!SJ_Amount.Value,"0")) > 1, "# " + Last(Fields!TotAmount.Value), Last(Fields!TotAmount.Value)

    ... and closing parentese missing
  • sharon95sharon95 Member Posts: 183
    lubost wrote: »
    You shoud convert bolded value to string:
    =iif(Int(Filter(Fields!SJ_Amount.Value,"0")) > 1, "# " + Last(Fields!TotAmount.Value), Last(Fields!TotAmount.Value)

    ... and closing parentese missing

    Like this =iif(Int(Filter(Fields!ServiceJob_Amount.Value,"*")) > 1, "** " + Last(Fields!TotalAmount.Value), Format(Last(Fields!TotalAmount.Value),"Text")) ?

    I still get an error.. also format(..,"String") gives me an error
  • sharon95sharon95 Member Posts: 183
    also this doesn't work...
    =iif(Count(Filter(Fields!SJob_Amount.Value,0)) > 1, "# " + Last(Fields!TAmount.Value).ToString, Last(Fields!TAmount.Value).ToString)
Sign In or Register to comment.