Skip to main content
Solved

Sales Aging inquiry/report


Forum|alt.badge.img

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

Best answer by Robert Sternberg

Hi @swartzfeger hope this helps!

 

View original
Did this topic help you find an answer to your question?

17 replies

Laura02
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3132 replies
  • July 19, 2023

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


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • July 19, 2023
Laura02 wrote:

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. :)


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • July 19, 2023
Laura02 wrote:

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?


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2756 replies
  • August 9, 2023

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


Robert Sternberg
Captain II
Forum|alt.badge.img+7

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


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • August 14, 2023
Robert Sternberg wrote:

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

Chris Hackett wrote:

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.


Robert Sternberg
Captain II
Forum|alt.badge.img+7

Hi @swartzfeger hope this helps!

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • August 14, 2023
Robert Sternberg wrote:

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!


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • August 14, 2023
Robert Sternberg wrote:

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')


Robert Sternberg
Captain II
Forum|alt.badge.img+7

@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')

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • August 14, 2023
Robert Sternberg wrote:

@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?


Robert Sternberg
Captain II
Forum|alt.badge.img+7

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!

https://community.acumatica.com/ideas/allow-aggregates-in-row-style-of-generic-inquiry-screen-16263

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 172 replies
  • August 14, 2023
Robert Sternberg wrote:

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!

https://community.acumatica.com/ideas/allow-aggregates-in-row-style-of-generic-inquiry-screen-16263

 

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


Robert Sternberg
Captain II
Forum|alt.badge.img+7

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!


Fred Reiter
Freshman I
  • Freshman I
  • 6 replies
  • August 24, 2023

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')


Robert Sternberg
Captain II
Forum|alt.badge.img+7
Fred Reiter wrote:

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!


Forum|alt.badge.img
  • Freshman I
  • 22 replies
  • March 18, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings