1 Reply Latest reply on Nov 21, 2016 6:57 AM by Dan Huff

    How to choose a measure selectively?

    Michael Ye

      I have a data source with some dimensions and measures (such as sales_this_year, sales_last_year and sales_two_years_ago, but some sales data are missing.). I will build a reporting. The measure (sales_chosen) I want to choose is: If all sales data are in the database, then I will choose sales_this_year. If sales_this year is missing, I will choose sales_last year. If both of these sales are missing, then I will choose sales_two_years_ago. How to define the function of sales_chosen?

       

      Thanks!

        • 1. Re: How to choose a measure selectively?
          Dan Huff

          Michael--

           

          This question is quite hard to answer without a sample of data to work against. I say this because it depends on what your definition of "all sales are in the database" is (data for every day up to today during the year, data for a full calendar year, etc ?? ) and how the data that is missing is stored (is it stored as nulls, is it stored as 0s ??).

           

          If you could post a sample dataset or two--one where we would use sales_this_year and one where sales_this_year is incomplete but sales_last_year is complete--somebody may be able to help out.

           

          Dan