AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Generic inquiry tha...
 
Notifications
Clear all

Questions Generic inquiry that returns sales orders that include two or more inventory IDs

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by John Doe Updated 8 years ago
4 Posts
2 Users
0 Reactions
3,404 Views
RSS
Daniel Rogge
Posts: 3
 Daniel Rogge
Topic starter
July 13, 2017 2:55 pm
(@drogge)
Active Member
Joined: 6 years ago

I have the basics of generic inquiries down.  If we sell apples, I can return all sales orders with apples.  If we sell oranges too, I can return all sales orders that have oranges on them.  (add SOLine table, then in results grid display the InventoryID_Description).  I can use an OR condition to display all SOs that have either an apple or an orange on them.

The problem comes when I want to display only the SOs for customers who bought both and apple and and orange on the same SO.  Using an AND condition on SOLine.InventoryID returns no data, presumably because no one line on my sales orders has both and apple and an orange.  How can I find every sales order that includes both apples and oranges?

Thanks!!!


3 Replies
John Doe Updated
Posts: 3193
 John Doe Updated
Admin
July 13, 2017 3:11 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Hi Drogge,

Thanks for joining ARC.

Are you just looking for if they purchased Apples and Oranges or could it be any combination of two items?


Reply
Daniel Rogge
Posts: 3
 Daniel Rogge
Topic starter
July 13, 2017 4:07 pm
(@drogge)
Active Member
Joined: 6 years ago

Tim,

Only if they buy and apple and an orange, or two apples and an orange, ore three oranges and an apple.  If they buy an apple and a banana, that sales order shouldn't show up in this report.

Thanks! 


Reply
John Doe Updated
Posts: 3193
 John Doe Updated
Admin
July 13, 2017 10:58 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Got it.

I'm thinking that you could compare the MIN InventoryID to the MAX InventoryID to see if they are the same. That would tell you which orders to keep


Generic Inquiry

I don't think you can do this cleanly in Generic Inquiry because you have to be able to use the result of an aggregate calculation in a formula to filter them out.

Use the SOLine DAC Table and group on OrderType and OrderNbr to get one record per order.

Then you could grab the MIN InventoryID and display it using this on the Results Grid tab:

But that won't work because we need to look at both MIN InventoryID and MAX InventoryID.

So you'd probably want to use a formula like this:
=IIf(Min([SOLine.InventoryID])=Max([SOLine.InventoryID]),'No','Yes')

Which would give you this as a result:

You can compare the previous screenshot to the actual data set which looks like this:

The problem is that you can't filter on the More Than 1 SKU column because you will get this error message:

"Cannot perform an aggregate function on an expression containing an aggregate or a subquery."


Report Designer

It's a little cleaner in Report Designer because you could still group by OrderType and OrderNbr then suppress the printing of the group section for records with only one SKU like this:

Here is what the report looks like on my demo data:

Here is the sample timreporttest001.rpx Report Designer file that put together if you want to use it as a starting point.

https://timrodman.s3.us-east-2.amazonaws.com/forums/3-timreporttest001.rpx

But I'm not sure if you can get a total count using a formula. I think you can, but I haven't tried it yet. Maybe you can try it and let me know.


Excel or Power BI

This kind of thing is really best done in Excel or Power BI in my opinion.

Excel and Power BI are really good at working with aggregates in their formulas.


Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 24 Online
  • 2,410 Members
Our newest member: thollings
Latest Post: Attribute Input Mask
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×