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 Dashboard...
Dashboard to displa...
 
Notifications
Clear all

Questions Dashboard to display Sales for current month and current year for each salesperson

 
Page 2 / 2 Prev
Acumatica Dashboards
Last Post by Amanda Biggart 2 years ago
24 Posts
5 Users
2 Reactions
11.6 K Views
RSS
Posts: 58
 sunwayfan
Topic starter
March 8, 2018 5:02 pm
(@sunwayfan)
Member
Joined: 8 years ago

For Sales Comparison by Item Class what should be the relation between ARInvoice and InventoryItem table?

Right-click to Download


Reply
russ
Posts: 31
 russ
March 8, 2018 5:05 pm
(@russ)
Eminent Member
Joined: 5 years ago

What version of Acumatica are you running?  I get an error trying to upload the xml file.  


Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
March 9, 2018 11:28 pm
(@timrodman)
Famed Member
Joined: 10 years ago

I was able to upload the xml file into build 17.204.0019. But I've had trouble sometimes with these xml files. Not completely sure why though.

For the join, you want to join on ARTran, not ARInvoice because the Inventory Item lives at the line level of the invoice.

Try this, making sure to set the Join Type to Left because there may or may not be an Inventory Item on the line.


Reply
 sunwayfan
(@sunwayfan)
Joined: 8 years ago

Member
Posts: 58
March 18, 2018 9:15 pm
Reply toTim RodmanTim Rodman

Thank you Tim!

How can I find out the relationship between any 2 tables?  Is it listed out somewhere?

Is this right?
I am confused which field is to be chosen while mapping the 2 tables


Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
March 19, 2018 11:18 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Joining tables together is by far the trickiest thing about building generic inquiries. I used to try to teach people how to do it, but eventually settled on, "hey, you can do everything else, but call your partner when it gets to the Relations tab."

The reason is that you really need an understanding of normalized databases, primary keys on tables, and how joins work. It's also helpful to know how ERP tables are typically structured in general so you know where to expect to find certain information.

For your particular example, what I would do is open the database and find the primary key on the CustomerClass table. The primary key could be made up of more than one column. Now, even though Data Access Classes which you are working with in the Generic Inquiry and the Tables in the database are not the same thing, I would say that about 90% of the time, they happen to have the same names. So, this isn't a 100% of the time method, but usually it works.

Checking the CustomerClass table in the database shows me that CustomerClassID is the only column needed to form a primary key.

But you won't find CustomerClassID in any of your existing tables. You'll need to join to Customer on ARInvoice.CustomerID = Customer.BAccountID, then from Customer you can join to CustomerClass on Customer.CustomerClassID = CustomerClass.CustomerClassID.


Reply
The Mangolorian
Posts: 1
 The Mangolorian
August 25, 2021 2:16 pm
(@mangolorian)
New Member
Joined: 4 years ago

Hi Everyone,

 

I have been following Tim’s video to do a report that will show sales by item class and by period. I managed to make it work as a GI but since I need I to  grouped it by period as well, I had to make it into a report. However, the sum formula doesn’t work in this case, it is somehow combining numbers from the group instead of summing. Is it the iif formula that is throwing it off?

This is the formula I used to sum MTD:

=Sum(IIf(Year([SOOrder.OrderDate])=Year(@AsofDate) And Month([SOOrder.OrderDate])=Month(@AsofDate),[ARTran.NetSalesAmount],0))

image

and this is the GI which is working:

image

It would be great if there was a simpler way in pulling sales by period ([ARTran.FinPeriodID]) instead of pulling them by order nbr and grouping them. My end goal would be to display those columns by period and then broken down by item class.


Reply
Tim Rodman reacted
Amanda Biggart
Posts: 4
 Amanda Biggart
October 2, 2023 4:55 pm
(@abiggart)
Active Member
Joined: 2 years ago

I stumbled upon this wonderful thread and it has been very helpful. The issue (I think) I am having is that the report doesn't account for credit memos properly. I have another report I use for activity and it uses the AR Tran table. I had to include this formula in my sales column to account for transactions that were credit memos =IIf( [ARTran.DrCr]='D', -1, 1 )*[ARTran.TranAmt] (so that if a credit memo then the amount would post as a negative amount and subtract from the sales).

 

My question is what is the best way to roll this (=IIf( [ARTran.DrCr]='D', -1, 1 )*[ARTran.TranAmt]) into your formulas above? I have tried a couple variations but no luck, but I've noticed our sales rep #'s for MTD are slightly off and I believe its because the system is adding a credit memo instead of subtracting the value.

 

Any insight would be helpful.


Reply
Amanda Biggart
Posts: 4
 Amanda Biggart
October 9, 2023 3:52 pm
(@abiggart)
Active Member
Joined: 2 years ago

In case anyone else runs into this scenario......THE ANSWER IS.......

=iif([ARTran.DrCr]='D',(IIf(Year([ARInvoice.DocDate])=Year(Today()) And Month([ARInvoice.DocDate])<=Month(Today()),(-1*[ARTran.CuryExtPrice]),0)),(IIf(Year([ARInvoice.DocDate])=Year(Today()) And Month([ARInvoice.DocDate])<=Month(Today()),(1*[ARTran.CuryExtPrice]),0)))

 

After many hours and persistence, I was finally able to get a formula that displayed the proper values (taking into account negative signs for credit memos)


Reply
Tim Rodman reacted
Page 2 / 2 Prev
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 10 Online
  • 2,324 Members
Our newest member: Michael Kiley
Latest Post: Pick List report suddenly not splitting on Shipment
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.

‹›×

    ‹›×