Pulling the last Unit Cost of a part within a specific timeframe

,

Thank you for ALL the information. I will try it here in a few - have to get out the morning reports first.

I’ll let you know - Again, thank you so much!

I’m getting an error:
Windowed functions can only appear in the SELECT or ORDER BY clauses.

?

Show your work

We don’t used the LbrUnitCost, BurUnitCost, etc. I’m just capturing InvcDtl.DocUnitCost.

My formula:

Row_Number() over (partition by InvcDtl.PartNum,(InvcDtl.DocUnitPrice)
                   order by InvcDtl.ShipDate Desc)

First, is this formula formatted correctly?

1 Like

In K2024.1, I have no DocUnitCost nor UnitCost. I had to add up the components.

What does the error mean, what is it referring to? The calculated field? Something not joined properly? I don’t know where to begin to look.

Windowed functions can only appear in the SELECT or ORDER BY clauses

Got it…I was doing a “Group By” in the Subquery. In my investigation it said to NOT do a “Group By” in the Subquery and Voila! It worked!!!

1 Like

Sorry…InvcDtl.DocUnitPrice

Mark I just want to thank you for your time. I have learned so much from this and am adding all this information to my notes. I’m self taught so this was an awesome experience.

Again, thank you so much.

1 Like

And I learned this from @Banderson. We just pass it along here!

2 Likes

I liked the idea behind this BAQ so I quickly built one for myself, but we use the cost tables and so it would have been of little use to Judy. I will leave this version that I just made for any who come later looking for help that DO use costing. It brings in all active parts with standard costing, and gives the most recent “receipt” date for each price point that they have had. Maybe it helps others down the line. Turns out we have a lot of costs to potentially update!

SW-PriceUpdateByPart.baq (33.6 KB)

2 Likes