4 Replies Latest reply on Apr 18, 2013 9:16 PM by Joshua Milligan

    Calculation Rollup to Error instead of 0

    Bryce McDonnell

      I have data like this:

       

      year
      # of things
      2011NULL
      2012NULL
      2013100

       

      I have a parameter that will filter by year or display a sum of all time.

       

      When I sum all time, the sum of "# of things" rolls up to 100. It sums 2011 and 2012 as 0. Instead, I'd like to have it display an error.

       

      I've tried several different approaches of a calculated field but none have worked. The result needs to be a continuous measure or an error. This feels like a fairly straightforward function but I can't find it. Any help is appreciated.

       

      Thanks,

      Bryce

       

      Some attempts at calculated fields:

       

      IF ZN([# of things]) == 0

      THEN "ERROR"

      ELSE [# of things]

      END

      # fails because return values are not same type

       

      IF ZN([# of things]) == 0

      THEN "ERROR"

      ELSE STR([# of things])

      END

      # fails because not continuous measure