Count the number of customers depending on specified levels (nested if)

Hi all,

I am trying to create a count of customers depending on set Orders Recevied intervals. I.e. for the specific time periods, how many customers made orders within e.g.
1. Above 100 EUR but below 50.000 EUR (100<50.000)
2. Equal or above 50.000 EUR or below 100.000 EUR (>=50.000<100.000)

I have come this far but I cannot seem to get the second argument in there. And for the 2 criteria, I am not sure how to get the "="-sign in there.

Thankful for any help

2 replies

    • Senior Director of Product
    • Ian_Macdonald
    • 10 mths ago
    • Reported - view

    Hi Niclas,

    Generally for these types of queries, where there is a need to filter then count a set, it is more efficient to take a slightly different approach, evaluating the condition, assigning a 1 or 0, then summing.

    So for your first example above, testing between 100 and 50000 we could write:

    Resulting in:

    Hope that helps!


      • Niclas_Lovgren
      • 10 mths ago
      • Reported - view

      Sorry for late reply. Many thanks!

Content aside

  • Status Answered
  • 10 mths agoLast active
  • 2Replies
  • 62Views
  • 2 Following