I’ve been asked to create a BAQ that returns the top two scrap reasons by Part number. Sounded simple but apparently it’s NOT!
I have 9 Union SubQueries because of customized scrap reporting. We can record up to 10 scrap reasons in a single labor instance.
At the Top I group by Part Number and Reason code and sum the total scrap. I want it to return the top two scrap reasons for all parts. I had thought distinct top would do it but it only returns two part numbers. I’m sorting by part number then scrap qty.
Thanks for your help! — I’m NOT very good at Code so it took me a bit to get the syntex right but here is what I ended up with. I the Scrap Qty is a calculated field to sum by Part number and reason. It wouldn’t let me criteria for just 1 and 2 rankings because of the group by, so I threw it into a dashboard where I could filter the results. I’m sure there is a better way but this will serve the purpose! Thanks again for your help