Skip to main content
Question

Sales Order History GI/report

  • January 27, 2025
  • 4 replies
  • 77 views

Forum|alt.badge.img

Hi all,

I was asked to write a GI/report and I’m banging my head figuring out how to do this.

We want to write a sales order history report with a date range, say month to date. Easy enough I can setup parameters for that.

What my sales director would like to see is -- for the items that were sold this week (or month), when was the last time that item was ordered?

So for instance --

ABC-123: 01/27/2025 - $3000 USD
ABC-123: 07/01/2024 - $1900 USD

I’m trying to think of ways to limit showing just the last/previous sales in the result grid for that stock item (or I could show the last order date from that specific customer, we’re not really as concerned about the item itself, moreso about when the customer last ordered).

Any thoughts? Could I do something in the results grid to show the previous order data and limit it to just that previous order?

Thanks for any ideas!

 

4 replies

lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 590 replies
  • January 27, 2025

Hi ​@swartzfeger ,

To see the customer, item, and the last order date for a customer and item, you can group that data.

First, In the conditions in the report Schema Builder include a condition to filter SOOrder by OrderDate for your desired date range.  

In the Groups collection of the report properties, add a group that groups by SOOrder.CustomerID and SOLine.InventoryID.  In the header or footer for that group, add a text field with a formula like max([SOOrder.OrderDate]).

If you need to see other details, such as the order number, that can be accomplished using a left join.  The idea is to check that there isn't another order for the same inventoryid and customer with a later date.  Let me know if that's your objective and I can provide more details.

Hope this helps!

Laura 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 171 replies
  • January 29, 2025
lauraj46 wrote:

Hi ​@swartzfeger ,

To see the customer, item, and the last order date for a customer and item, you can group that data.

First, In the conditions in the report Schema Builder include a condition to filter SOOrder by OrderDate for your desired date range.  

In the Groups collection of the report properties, add a group that groups by SOOrder.CustomerID and SOLine.InventoryID.  In the header or footer for that group, add a text field with a formula like max([SOOrder.OrderDate]).

If you need to see other details, such as the order number, that can be accomplished using a left join.  The idea is to check that there isn't another order for the same inventoryid and customer with a later date.  Let me know if that's your objective and I can provide more details.

Hope this helps!

Laura 

Sorry for the delay, Laura -- thank you for the detailed response! Will be working on this today and implementing your method. Leaving this open as I may have a few questions, lol. :)


Forum|alt.badge.img
  • Author
  • Freshman II
  • 171 replies
  • January 29, 2025
lauraj46 wrote:

Hi ​@swartzfeger ,

To see the customer, item, and the last order date for a customer and item, you can group that data.

First, In the conditions in the report Schema Builder include a condition to filter SOOrder by OrderDate for your desired date range.  

In the Groups collection of the report properties, add a group that groups by SOOrder.CustomerID and SOLine.InventoryID.  In the header or footer for that group, add a text field with a formula like max([SOOrder.OrderDate]).

If you need to see other details, such as the order number, that can be accomplished using a left join.  The idea is to check that there isn't another order for the same inventoryid and customer with a later date.  Let me know if that's your objective and I can provide more details.

Hope this helps!

Laura 

Hi Laura, I’ve mostly had luck with this but there are some hangups --

It lists the customers’ current order, order date and order total, and it lists the previous SO’s correct date, but the previous SO# and previous SO total is duplicating the current order’s values.

One of the things is I’m probably using the formulas incorrectly--

=max([SOOrder.OrderNbr])

=max([SOOrder.OrderDate])

=max([SOOrder.CuryOrderTotal])

Also, I “repurposed” an old report so there are parameters for other data ranges that aren’t being used (ranges B through F, but for some reason when I delte those parameters the report won’t load, so I just hid their visibility).

Thanks if anyone is able to look at the the .rpx!


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 590 replies
  • January 30, 2025

Hi ​@swartzfeger ,

Because SOOrder.OrderNbr is a field in your grouping, the footer section will be displayed for each individual order.  Remove this field from the grouping to display only footer per customer with the maximum order date in the footer.  You could also unhide the detail section to see the individual order details above.  To display everything on one line is trickier and would probably require the use of  variables.

Hope this helps!

Laura


Reply


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