Skip to main content
Answer

How to display total number of payments made by customer in GI

  • January 19, 2024
  • 5 replies
  • 222 views

Forum|alt.badge.img

Hello all,

I have been looking how can I calculate the number of payments done by the customer in a GI?

Best answer by BenjaminCrisman

@Harry the Count aggregate function will only work if there is a grouping applied to the records, which would be exactly what would be needed here, grouping conditions.

I would group on the customer for the payment and then use a Count() function or Count aggregate function to display the number of payments in the group.
You can quickly get this done by copying the AR Payments and Applications GI into a new one.

Then add a grouping:

Then add the function on the results grid and remove/add any fields you want to use:

Then the results will show you the number of payments for that customer:

 

5 replies

Forum|alt.badge.img+1
  • Varsity I
  • January 19, 2024

Hi @Harry 

If I’m reading your question correctly, you could aggregate using COUNT on the ARPayament RefNbr field...

 

 

 


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • Answer
  • January 19, 2024

@Harry the Count aggregate function will only work if there is a grouping applied to the records, which would be exactly what would be needed here, grouping conditions.

I would group on the customer for the payment and then use a Count() function or Count aggregate function to display the number of payments in the group.
You can quickly get this done by copying the AR Payments and Applications GI into a new one.

Then add a grouping:

Then add the function on the results grid and remove/add any fields you want to use:

Then the results will show you the number of payments for that customer:

 


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • January 20, 2024

Hello @BenjaminCrisman,

Thank you for your quick suggestion. How can I apply the condition if I would only want to display the count of payments for the last 12 months?

Thanks in advance.


Laura03
Captain II
Forum|alt.badge.img+19
  • Captain II
  • January 20, 2024

Hello, 

Add two parameters to prompt the user for begin/end month. Add condition to select where Post Period (financial period) is between the begin month parameter and the end month parameter.

 

Laura


bryanb39
Pro II
Forum|alt.badge.img+6
  • Pro II
  • January 20, 2024

If you want it hard coded to show 12 Months, you can add a condition for the DocDate to be greater than or equal to DateAdd(Today(),'M',-12). This will filter to 12 Months to the day, so mid month if it’s mid month now.  There’s a couple ways to do calendar month if you prefer, let me know if you need to calendar.

To show 12 Months, 3 Months, all time at the same time to show a trend, you can add the formula: =iif([ARPayment.DocDate] >= DateAdd(Today(),'M',-12),1,0) and set the Aggregation to SUM.  

To combine this with @Laura02’s suggestion, you can have it default to a range when Parameter is blank, or filter by Period Parameter if the user fills out the period or date range.