4 Replies Latest reply on Dec 1, 2018 5:12 AM by Gavin Wong

    Counting the number of unique order id if condition is true

    Gavin Wong

      Hi Community,


      using the sample superstore as example, i wrote 2 calculated fields

      Calculation 1

      [Order Date]={MAX([Order Date])}


      IF [Calculation1]=TRUE then COUNTD([Order ID])



      But the error says i cannot mix aggregate and non aggregate comparisons...

      what am i missing here.


      however, if i were to write


      IF [Calculation1]=TRUE then [sales]

      which calculates the sum of sales when the condition is met.


      how then can i count the number of unique order ids when the condition is met ?