Solved

Sales Aging inquiry/report


Userlevel 5
Badge

All,

 

This is making me feel pretty stupid, lol. I’m trying to determine a list of customers who have not ordered from us in the last 18 months. So I’m writing an inquiry and using “@Today-500” but all that’s going to do is show sales from 18+ months ago.

I need to determine customers whose last placed order was less than or equal to @Today-500

 

I think I need to do some sort of “AND SOrder.OrderDate IS EMPTY between @Today and @Today-500 but not sure how to express that here.

So basically select * from CustomerID where lastorder is Less Than or Equal To @Today-500

icon

Best answer by Robert Sternberg 14 August 2023, 22:48

View original

17 replies

Badge +18

Hi,

I have some ideas as follows:

  1. Join Customer table to Sales Orders with a Left Join (show all customers whether they have orders or not).
  2. Aggregate/Group the results by Customer ID.
  3. Add a Count field to the Results, to count # Sales Orders per customer. (Count sales order reference numbers.)
  4. Add a Condition to  select where the Count of sales orders is 0.
  5. Add a range of dates to your Parameter and Conditions, so the GI is flexible to show any range of dates.

Laura

Userlevel 5
Badge

Hi,

I have some ideas as follows:

  1. Join Customer table to Sales Orders with a Left Join (show all customers whether they have orders or not).
  2. Aggregate/Group the results by Customer ID.
  3. Add a Count field to the Results, to count # Sales Orders per customer. (Count sales order reference numbers.)
  4. Add a Condition to  select where the Count of sales orders is 0.
  5. Add a range of dates to your Parameter and Conditions, so the GI is flexible to show any range of dates.

Laura

No caffeine yet but I’m slowly seeing what you’re doing here. Pretty crafty, going to try this now. :)

Userlevel 5
Badge

Hi,

I have some ideas as follows:

  1. Join Customer table to Sales Orders with a Left Join (show all customers whether they have orders or not).
  2. Aggregate/Group the results by Customer ID.
  3. Add a Count field to the Results, to count # Sales Orders per customer. (Count sales order reference numbers.)
  4. Add a Condition to  select where the Count of sales orders is 0.
  5. Add a range of dates to your Parameter and Conditions, so the GI is flexible to show any range of dates.

Laura

Hi Laura, the initial GI worked great -- I grouped/aggregated by customer, got the counts etc. Now it’s not returning anything after I put in the conditions and parameters:

I think the issue is -- how do I set the condition to get the count? The one I have highlighted above is obviously wrong, because I need to get the count of 0, not SOrder.OrderNbr = 0

Or is there a way to do some sort of conditional in the results grid?

Userlevel 7
Badge

Hi @swartzfeger were you able to find a solution? Thank you!

Userlevel 7
Badge +8

Hi @swartzfeger can you please provide a .xml of your current GI so I can take a look?  Thank you

Userlevel 5
Badge

Hi @swartzfeger can you please provide a .xml of your current GI so I can take a look?  Thank you

Hi @swartzfeger were you able to find a solution? Thank you!

Hey all, thanks for the followup -- have been slammed here at work and haven’t had time to investigate this further.

Here’s the sales aging report that I have so far.

Thanks for any input/suggestions you may have.

Userlevel 7
Badge +8

Hi @swartzfeger hope this helps!

 

Userlevel 5
Badge

Hi @swartzfeger hope this helps!

 

Robert this is INCREDIBLE! Thank you! I need to look at it to modify, as I want customers with 0 total orders to be listed as Stale instead of healthy but otherwise it’s perfect!

Userlevel 5
Badge

Hi @swartzfeger hope this helps!

 

Robert, what would be the best way to modify this so if total orders = 0, then STALE?

 

=IIF((COUNT([AllOrders.OrderNbr])>0) And (COUNT([OrdersAfterStaleDate.OrderNbr])=0),'STALE','HEALTHY')

Userlevel 7
Badge +8

@swartzfeger 

Glad it helps, I would use this instead.  

=IIF((COUNT([AllOrders.OrderNbr]) > 0 AND COUNT([OrdersAfterStaleDate.OrderNbr]) = 0) OR COUNT([AllOrders.OrderNbr]) = 0, 'STALE', 'HEALTHY')

 

Userlevel 5
Badge

@swartzfeger

Glad it helps, I would use this instead.  

=IIF((COUNT([AllOrders.OrderNbr]) > 0 AND COUNT([OrdersAfterStaleDate.OrderNbr]) = 0) OR COUNT([AllOrders.OrderNbr]) = 0, 'STALE', 'HEALTHY')

 

THanks that did the trick… one more question if you have the time… for the row formatting I would like to do something like this:

 

=iif([OrdersAfterStaleDate.Status] = 'STALE', 'default', 'yellow')

 

But it’s turning everything yellow regardless of status… did I mess something up with the statement?

Userlevel 7
Badge +8

No, unfortunately using aggregate functions is not supported in style flags.  For this you would need to build a view that returns the sudo-’Status’ value.  

Vote on this idea and maybe we will see this implemented in the future!

 

Userlevel 5
Badge

No, unfortunately using aggregate functions is not supported in style flags.  For this you would need to build a view that returns the sudo-’Status’ value.  

Vote on this idea and maybe we will see this implemented in the future!

 

Ahhhh, that makes sense… thanks again Robert, I’m off to vote :)

Userlevel 7
Badge +8

No problem, try a shared filter on the GI of ‘Stale’ that has worked for me in the past as a substitute for styling aggregates!

Userlevel 1

Adding the style colors to an aggregate field is possible if you get the default Formula field name before you use a caption and substitute that value into the formula like this: =iif([Customer_Formulac5cd321184654a64a72057de20d51c25] = 'STALE', 'default', 'yellow')

Userlevel 7
Badge +8

Adding the style colors to an aggregate field is possible if you get the default Formula field name before you use a caption and substitute that value into the formula like this: =iif([Customer_Formulac5cd321184654a64a72057de20d51c25] = 'STALE', 'default', 'yellow')

@Fred Reiter

This is an awesome idea, I will test it out.   Have you tried using this in the cell style and row style?  I wonder if it works for both.  Thanks for sharing!

Userlevel 1
Badge

Thanks for the above info.

 

I think the real question is, why is there no inbuilt sales history generic inquiry? This is one of main pages for other CRMs

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved