This content has been marked as final. Show 3 replies
I am trying to count the number of jobs my company runs in a given year. We use the same job number over multiple days (or weeks), so I only want to count each job number the for the first date it was used. I have successfully done this in the data load script, but I am getting slightly incorrect results using the Aggr() function. Here is what I am doing and the results.
Year(JobDate) AS JobYear,
Text(Month(JobDate))&'-'&Text(Year(JobDate)) AS JobMonthYear,
SQL SELECT JobDate,
WHERE JobDate >= '2010-01-01';
Text(Month(MinJobDate))&'-'&Text(Year(MinJobDate)) AS JobMonthYear,
Count(JobNo) AS JobCount
Group By Text(Month(MinJobDate))&'-'&Text(Year(MinJobDate));
Min(JobDate) AS MinJobDate,
Group By JobNo;
As you can see, the total counts are the same, but there are small differences. I have verified externally that the Sum(JobCount) results are correct. I have tried everything I can think of and I can't find where these variances are coming from. Thanks in advance.