Francis P. Posted September 22, 2012 Share Posted September 22, 2012 Hi all, I have a very simple table with the following fields (product , from_location , to_location , quantity and date). How can I create a three column report that to shows totals received, issued and on hand for each location. Thanks. Link to comment Share on other sites More sharing options...
comment Posted September 22, 2012 Share Posted September 22, 2012 This, surprisingly, is not going to be simple. Do you also have a table of Locations (where each location has a unique record) and a similar table for products? Link to comment Share on other sites More sharing options...
Francis P. Posted September 23, 2012 Author Share Posted September 23, 2012 Yes I have both these tables. Link to comment Share on other sites More sharing options...
comment Posted September 23, 2012 Share Posted September 23, 2012 Well, to produce a report for a single location, you'd find all transactions affecting the location (whether from or to) and sort them by product, then by type (incoming or outgoing). To calculate the type, you need to have the selected location's ID in a global field or variable. Hopefully, the rest is obvious. Another approach is to have the selected location's ID in a global field in the Products table. Then you can have two relationships linking Products to Transactions, matching on both ProductID and LocationID. Link to comment Share on other sites More sharing options...
Francis P. Posted September 23, 2012 Author Share Posted September 23, 2012 How do I get the selected location ID in a global field or variable? I know how to create global fields. Link to comment Share on other sites More sharing options...
comment Posted September 23, 2012 Share Posted September 23, 2012 Assuming the report process is scripted, and that the script is called from the selected location's record, start the script by: SetField [ AnyTable::gLocationID ; Locations::LocationID ] or SetVariable [ $$locationID ; Locations::LocationID ] Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 4239 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now