3 Replies Latest reply on Apr 25, 2016 6:28 PM by msa s

    null values using zn

    msa s

      hi

       

      i created a calculated field for ytd, but recieved null values

      and tried to use zn ? any suggestion

        • 1. Re: null values using zn
          Brent Mathison

          Hi. If you are using the Superstore data, calculating the year based on the TODAY() function will give you NULL values - there is no 2016 data in the Superstore dataset. The formula you have shown, even if it had no errors, would theoretically give you only YTD sales for 2016. What is it that you're trying to accomplish?

          1 of 1 people found this helpful
          • 2. Re: null values using zn
            Shinichiro Murakami

            [ytd]

            if [Order Date]<= [date param]

            and DATEDIFF('year',[Order Date],[date param])=0

            then [Sales]

            END

             

            You can change [date param] to [today()] with real data set.

            But current data does not have matching date and shows null.

             

            Thanks,

            Shin

             

            9.0 attached

            • 3. Re: null values using zn
              msa s

              this is for year 2011

               

              if [Order Date]<= TODAY()

              and DATEDIFF('year',[Order Date],TODAY())=5

              then [Sales]

              END

               

              ok got it now, i was looking for sum of sales for year 2016. i didnot know that there are no sales for this year.

              1 of 1 people found this helpful