2 Replies Latest reply on Oct 14, 2018 8:18 PM by Gavin Wong

    Returning the sales for an exact date

    Gavin Wong

      Sorry if this sounds trivial,

      but how do i return the sales for a specific date say

      2018-10-14

       

      I wrote it as this calculated field

       

      IF (DATEPART('year', [Order Date]))=2018

      AND

      (DATEPART('month', [Order Date]))=10

      AND

      (DATEPART('day', [Order Date]))=14

       

       

      THEN [Sales]

      ELSE 0

      END

       

       

      Is there a better way to write it ?

       

      I am using the sample superstore

       

      thanks