ABS value

  • I am passing a -ve value as a paremeter to show data for past 30/60/90 days.

    The issue is I want the header to show as

    = "Data for past" & ABS(Parameter!Number.value) & "days".

    As soon as I add ABS(Parameter!Number.value) it gives me an error.

    I don't want to display Data for past -30 days.

    Any ideas ????

  • sharonsql2013 (1/23/2015)


    I am passing a -ve value as a paremeter to show data for past 30/60/90 days.

    The issue is I want the header to show as

    = "Data for past" & ABS(Parameter!Number.value) & "days".

    As soon as I add ABS(Parameter!Number.value) it gives me an error.

    I don't want to display Data for past -30 days.

    Any ideas ????

    I might know but, to be sure, what is the exact error please?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Well the Error was #Error.

    But I figured it out , Just multipled by * -1 in the expression and didn't have to use and Abs

  • sharonsql2013 (1/23/2015)


    Well the Error was #Error.

    Yowch. Not fun. I hate such "informative" error messages.

    I'm sure there's an SSRS-language function to do the same thing but the multiplication will work in this case.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Did you set your parameter data type to Integer? Your value is being converted in the query it's passed to but within SSRS it is still defined as a string causing functions expecting a numeric datatype to error.

Viewing 5 posts - 1 through 4 (of 4 total)

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