0

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)
etc.

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
Niclas

2 replies

null
    • Senior Director of Product
    • Ian_Macdonald
    • 1 yr 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!

    Ian

      • Niclas_Lovgren
      • 1 yr ago
      • Reported - view

      Sorry for late reply. Many thanks!

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 2Replies
  • 64Views
  • 2 Following