Neil Scrivener Posted May 22, 2020 Posted May 22, 2020 Hi Guys, I'm back, with some final (hopefully) questions on Reporting. Assuming the Data looks like this: I can create Reports from the Item, Type, etc that's easy. What I'm struggling with is the following: 1. Making a Report which is sorted by Type, but only where the Qty is above 0. So where Bread, Cheese and Crackers would be excluded. 2. Making a Report which shows the 'top 10' owned, and 'bottom 5' owned - based on qty field. 3. Making a Report which shows me the 'best' month (a) per product and [which month did I have the most of all items] and (b) the same in year. I'd appreciate any help or advice Thanks! N
comment Posted May 22, 2020 Posted May 22, 2020 (edited) 5 hours ago, Neil Scrivener said: 1. Making a Report which is sorted by Type, but only where the Qty is above 0. Assuming that quantity cannot be negative, the only way that a quantity of a group can be 0 is if all the quantities in the group are 0. So simply start by performing a find for quantity > 0. 5 hours ago, Neil Scrivener said: 2. Making a Report which shows the 'top 10' owned, I assume you mean the top 10 types by quantity? For this, you will need to first sort your records by Type and then omit any records after the 10th group. This can be done quickly using an adaptation of a method called Fast Summaries by Mikhail Edoshin. Your table needs to have 2 summary fields: sTotal for totaling the quantity and sCount that counts some field that cannot be empty (e.g. ItemID). Start by finding the items iyou want to report on and sorting them by Type, reordered by sTotal, descending. This groups the items by type and places the groups with the highest quantities at the top of the report. Then make your script do: # GO TO FIRST RECORD OF EACH GROUP, USING "FAST SUMMARIES" Go to Record/Request/Page [ First ] Loop Set Variable [ $i; Value:$i + 1 ] Set Variable [ $nextRecord; Value:Get ( RecordNumber ) + GetSummary ( Items::sCount ; Items::Type) ] Exit Loop If [ $nextRecord > Get ( FoundCount ) or $i > 10 ] Go to Record/Request/Page [ $nextRecord ] [ No dialog ] End Loop # OMIT EXCESS RECORDS If [ $i > 10 ] Omit Multiple Records [ Get ( FoundCount ) - Get ( RecordNumber ) + 1 ][ No dialog ] End If I am afraid I did not understand #3. It sounds like there are several questions in there and each deserves its own thread. Edited May 22, 2020 by comment
Neil Scrivener Posted May 23, 2020 Author Posted May 23, 2020 Thanks for this will give a go. Should I be creating a Script to run the Find, so that if additional value are created - or that the Find gets reset, it can be re-instated? Or is it the case that once Find has been activated, it's 'locked in'?
comment Posted May 23, 2020 Posted May 23, 2020 I am not sure I understand the question. You said you wanted to produce a report. A script that produces a report will normally start by establishing a found set of the records to report on.
Neil Scrivener Posted May 23, 2020 Author Posted May 23, 2020 Thanks for this, I've ran into two problems: The first is that when using Find, inserting >18 I'm getting a message saying "No records match this criteria". However >0 works perfectly. Why is this? The second is that I have a nicely laid out report when sorted by Type. I have a sub-summary with with Type heading, and then the Body contains the vegitables and quantities. When performing a Find (as per the working one, above), my lovely titles and headings are vanishing, and I'm getting hard and fast data. I guess this is because Find it showing 'Body' only - but when creating a Report (say a paper of PDF), I'd want to perform the Find, and then keep the nicities of my Header, Sub-Summary, Footer etc.... How would I do that? Thanks! N
Neil Scrivener Posted May 23, 2020 Author Posted May 23, 2020 UPDATE, ignore my first issue. It was because it was a percentage I was filering, so I needed to put in .18 rather than 18. Second issue I remain stuck with
comment Posted May 24, 2020 Posted May 24, 2020 Sub-summary parts appear only when records are sorted by the associated break field. After performing a find, records are unsorted.
Neil Scrivener Posted May 24, 2020 Author Posted May 24, 2020 Got it! Thanks. For anyone else reading who experiences the same issues - I believe you need to: 1. Perform the Find in your Criteria 2. Sort Records I'm going to make a script that does this, and then when clicked takes you to the Print option - which should package everything nicely up
Recommended Posts
This topic is 1912 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