# BAQ to show last 3 closed jobs for each active part

**URL:** <https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117>\
**Category:** Epicor ERP 10\
**Tags:** baq\
**Created:** [May 20, 2023, 11:07pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117 "2023-05-20T23:07:22Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![yrobbie](https://www.epiusers.help/letter_avatar_proxy/v4/letter/y/5e9695/32.png) [@yrobbie](https://www.epiusers.help/u/yrobbie)\
**Post date:** [May 26, 2023, 12:26pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/21 "2023-05-26T12:26:13Z")

</div>

Brilliant thank you

---

<div class="post-metadata">

**Author:** ![jpol](https://www.epiusers.help/user_avatar/www.epiusers.help/jpol/32/69922_2.png) [@jpol](https://www.epiusers.help/u/jpol)\
**Post date:** [April 12, 2024, 4:53pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/22 "2024-04-12T16:53:44Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jpol](https://www.epiusers.help/user_avatar/www.epiusers.help/jpol/32/69922_2.png) [@jpol](https://www.epiusers.help/u/jpol)\
**Post date:** [April 16, 2024, 3:38pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/23 "2024-04-16T15:38:47Z")

</div>

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

Thank you!

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [April 16, 2024, 3:41pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/24 "2024-04-16T15:41:27Z")

</div>

Right here.

 ![image](https://www.epiusers.help/uploads/default/original/3X/d/3/d31058da873897242d6befdd951a13ff65d41d9d.png)

---

<div class="post-metadata">

**Author:** ![jpol](https://www.epiusers.help/user_avatar/www.epiusers.help/jpol/32/69922_2.png) [@jpol](https://www.epiusers.help/u/jpol)\
**Post date:** [April 16, 2024, 3:45pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/25 "2024-04-16T15:45:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jpol](https://www.epiusers.help/user_avatar/www.epiusers.help/jpol/32/69922_2.png) [@jpol](https://www.epiusers.help/u/jpol)\
**Post date:** [April 16, 2024, 6:43pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/26 "2024-04-16T18:43:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [April 16, 2024, 6:47pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/27 "2024-04-16T18:47:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jpol](https://www.epiusers.help/user_avatar/www.epiusers.help/jpol/32/69922_2.png) [@jpol](https://www.epiusers.help/u/jpol)\
**Post date:** [April 16, 2024, 6:50pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/28 "2024-04-16T18:50:52Z")

</div>

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 🤔

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [April 16, 2024, 6:52pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/29 "2024-04-16T18:52:00Z")

</div>

> [@jpol](#):
>
> Sorry, I thought you could read my mind 🤔

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?

---

<div class="post-metadata">

**Author:** ![jpol](https://www.epiusers.help/user_avatar/www.epiusers.help/jpol/32/69922_2.png) [@jpol](https://www.epiusers.help/u/jpol)\
**Post date:** [April 16, 2024, 6:55pm UTC](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117/30 "2024-04-16T18:55:20Z")

</div>

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!

[Previous page](https://www.epiusers.help/t/baq-to-show-last-3-closed-jobs-for-each-active-part/103117.md?page=1)
