Skip to main content
Solved

Using SUM Aggregate with Date Parameters

  • March 5, 2026
  • 9 replies
  • 85 views

Forum|alt.badge.img+1

Hi all! We have a generic inquiry showing the sum of all cases per customer.

The GI shows zero if the customer has no cases and shows the sum of all their cases if the customer does have any. All if working well here.

What we want is to have date parameters, where if the customer during the selected date range have cases, then show the sum of those cases during that period. If not, then show zero. So, regardless of the date range, all customers should always be listed in the GI, only the number of cases should change.

The problem right now is that if I select a date range, the GI only lists customers if they have cases created during that period. Customers with zero case created during that period will not show. 

We want the GI to always list all customers and show zero if there are no cases during the selected period instead of not showing the customer at all. 

Any thoughts on this? 

Thanks!

Best answer by darylbowman

Specify the date conditions in a Left Join to CRCase so that the CRCase is only joined if it meets the criteria. You shouldn't need to mess with formulas at all.

9 replies

jhalling52
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • March 5, 2026

Hi ​@jzhu,

 

What do the data joins look like? 


jhalling52
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • March 5, 2026

Can you make the date conditions inactive and try using this formula in the results grid for the # of cases?

=IIf([CRCase.CreatedDateTime] >= [StartDate]  AND [CRCase.CreatedDateTime] <= [EndDate], 1, 0)

 

The formula would need to be tweaked further if the date parameters are to be optional, but this is a start.


darylbowman
Captain II
Forum|alt.badge.img+16

Specify the date conditions in a Left Join to CRCase so that the CRCase is only joined if it meets the criteria. You shouldn't need to mess with formulas at all.


KrunalDoshi
Jr Varsity II
Forum|alt.badge.img
  • Jr Varsity II
  • March 6, 2026

Hi ​@jzhu,

If you want all Customers to be listed regardless of whether they have any case or not during the selected period, then you should start your join with Customer or BAccount of Type = ‘CU’. See below screenshot, this should give you the desired result.

Hope this helps!

 


darylbowman
Captain II
Forum|alt.badge.img+16

this should give you the desired result.

This would work without Conditions referencing CRCase fields. I'm fairly certain WITH said Conditions, this will remove those Customers with only matches that fall outside the dates.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • March 9, 2026

Specify the date conditions in a Left Join to CRCase so that the CRCase is only joined if it meets the criteria. You shouldn't need to mess with formulas at all.

Hi ​@darylbowman Is this what you mean here? 

 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • March 9, 2026

Hi ​@jzhu,

If you want all Customers to be listed regardless of whether they have any case or not during the selected period, then you should start your join with Customer or BAccount of Type = ‘CU’. See below screenshot, this should give you the desired result.

Hope this helps!

 

Hi ​@KrunalDoshi This is what I started with and unfortunately it didn’t not give me the desired result


KrunalDoshi
Jr Varsity II
Forum|alt.badge.img
  • Jr Varsity II
  • March 9, 2026

Hi ​@jzhu,

If you want all Customers to be listed regardless of whether they have any case or not during the selected period, then you should start your join with Customer or BAccount of Type = ‘CU’. See below screenshot, this should give you the desired result.

Hope this helps!

 

Hi ​@KrunalDoshi This is what I started with and unfortunately it didn’t not give me the desired result

Hi ​@jzhu,

Can you upload your GI, so I can check and suggest you the better solution. Above solution which I suggested has worked for me, so I am doubtful.


darylbowman
Captain II
Forum|alt.badge.img+16

Hi ​@darylbowman Is this what you mean here? 

Sort of. But it looks like you have it configured on the join from Customer to BAccount. It should be in the join from Customer to CRCase so that Cases are conditionally joined.