Display negative aggregates as zero

  • I'm quite new to SSAS, so please go easy on me.

    I have a measure which, when aggregated, can be positive or negative.

    If, after aggregation, the result is negative, I want to return zero rather than the negative value.

    What is the best way to do this?

    I'm using SSAS in multidimensional mode.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hi Phil,

    The best way is with a calculated measure, using a case statement to check if the sum (or aggregate) is less than zero.

    It would also be possible to do this with scope statement, but that could be a bit more complex.

  • Martin Schoombee (6/7/2016)


    Hi Phil,

    The best way is with a calculated measure, using a case statement to check if the sum (or aggregate) is less than zero.

    It would also be possible to do this with scope statement, but that could be a bit more complex.

    Thanks for the response, Martin. I'll give that a go. I was just reading about SCOPE and it does look a tad complex for a beginner.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

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

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