Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jcampbell474
Creator III
Creator III

Count if criteria met and within date range

I'm trying to count the number of times (Distinct) AgtID is listed if the agPhoneNum=callPhoneNum AND the DateQuoted is between sDate & sDate7.  (sDate7 is simply sDate + 7 days, defined in the script)  I'm not using any variables here.

Here is what I have, which works ONLY when a date is selected.

Count({<agPhoneNum = {'callPhoneNum'}>+<DateQuoted={">=$(=sDate)<=$(sDate7)"}>} AgtID)

I need something that will work even if a date is not selected.  It currently just zero's out.  The first column is Date in my chart (straight table), so date is a dimension.

What am I missing???  Why does a date have to be selected for the expression to work?

22 Replies
jcampbell474
Creator III
Creator III
Author

Thank you, Sunny!  I'll validate the numbers more tomorrow, but I put the expressions in my app it looks to accurate.

I often wonder when to use aggr vs set analysis.  Guess this is one of those times. 

Again, I really appreciate it!!

sunny_talwar

The problem with set analysis arises when you do comparison between fields. Since most likely the comparison is row by row comparison, set analysis will not work and you will have to use Aggr() function.

jcampbell474
Creator III
Creator III
Author

Ah, ok.  Makes sense.  I wasn't aware of that.  Thank you for the explanation!