BAQ to show last 3 closed jobs for each active part

I have, but I’ve always had a little trouble with it. I keep mentioning @Banderson, so I hope
he doesn’t get annoyed, but he did a presentation on it at Insights, and explained it really well.

I went from making it work, to understanding it, so he obviously did a good job.

I’m pretty sure he plans to do a summary for the forum so everyone here can benefit.
At least I hope he will.

Until he does, this is a good reference for this type of “windowing function”.
It’s not directly related to Epicor BAQs, but it’ll get you going:

http://www.silota.com/docs/recipes/sql-top-n-group.html

Awesome! I appreciate the support. I’ve got Brandon’s profile up, so I’ll check it out…and your link!

1 Like

Keep tuned for my presentation to be posted. I didn’t get to a lot of stuff that I wanted to due to the technical difficulties, but I plan on recording something to re-iterate what I did get to and expand on what I wasn’t able to get to. I just need to weekend to decompress.

2 Likes

Looks like it’s working, Kevin! I have to do some tweaking for all the fields the user wants. But, we should be good to go. Thanks, again!! Much appreciated. :grin:

1 Like

Can you share the BAQ please

KEV_Last3JobsActiveParts.baq (33.9 KB)

1 Like

here you go.

1 Like

tom hiddleston loki GIF

Not tom hiddleston, and not loki…

Brilliant thank you

1 Like

I’m very glad I found this post as I have been trying to do the same.

However, I am unable to import the BAQ example due to software version(?)

Anyway, can someone tell me where the <=3 is supposed to go? I am using the BAQ Designer.

Any help would be appreciated!

Does anyone have any feedback for me concerning my question as to where the
<=3 goes when using BAQ Designer?

Thank you!

Right here.

Thank you - I didn’t know I could do that, opens up a whole new world for me!

ummm…one more question…

I’m, receiving duplicate records, example:
10007 3683 2
10007 3683 3

10007 4081 2
10007 4081 3

I have tried a myriad of things to stop this but obviously I missing something.

Is there a “Rule of Thumb” that I should keep in mind when something like this happens?

Well, they aren’t duplicates. 3683 is not the same as 4081. So whatever those numbers are, I’m assuming that you are trying to ignore them? Is 10007 your part numbers? And 3683, 4081 your job numbers?

I don’t really know what you have in your BAQ, but a swag would be that your partitioning in the windowing function isn’t right. If you want to rank by part number, your partition needs to be by part number. If you have part number and job number, then it will separate by part number and job number.

Okay, that makes sense - I will look into that…
10007 Part Number
3683 Job Number
4081 Job Number

Sorry, I thought you could read my mind :thinking:

I’m trying really hard! But yeah, some screen shots and explanation of what you have so far would go a long way. You might even figure it our yourself just by trying to explain it.

Did you watch the video linked above about windowing functions?

Not yet and I do plan to.

As you advised…I had to partition on Job, I was partitioning on Part. Once I cleaned that up it worked like a charm.

I thank you for your patience - and as always, I am grateful for your help, I’ve learned so much!