I created a few calculated fields for one of my queries and would like to use these same fields in new/other queries. How do I do this without duplicating my efforts?
Thank you in advance!
Until this one is done
https://epicor-manufacturing.ideas.aha.io/ideas/ERP-I-158
(Baq source for other BAQās)
You will have to copy paste. It sucksā¦
I tried to copy/paste, but once I āleftā the copy query, I was not able to paste into the target query. Any tips?
I usually open up 2 BAQ windows. You can Shift click the menu item, and will open a second window so you can have them side by side. The calculated field menu is modal, so you will have to get in and out of that window (or open up 2 completely different instances of epicor ).
Also, I turn on the windows+V feature so that I can have more than one thing at a time in my clipboard. It helps for stuff like that.
A final note to keep in mind is that you might have to change the table name if you have aliases set up on the tables. This happens when you have the same table 2 or more times in the same query. That little window that pops up that asks you to make a new name for it. So check your syntax on every field as you make it so you know when an error occurs so you donāt have so much stuff to go picking through.
And this should workā¦ Itās just text.
I will walk through your recommendations and see how it goes. Thank you!
I was able to open 2 BAQ windows in the same plant by using Shift+Click. So, they are side-by-side.
I go to Window 1, pull up the Calculated Field SQL Editor.
I click on the calculated field, go to Edit and select copy (Ctrl+V)
I close out of the Editor
I go to Window2, pull up the Calculated Field SQL Editor
Go to Edit and paste - no luck
Go to New and paste - no luck
Iām not sure I understand your last paragraph. Perhaps because Iām so new Iāve never changed a table name. I didnāt think that was possible.
Love the tip for Windows+V clipboard!
Hereās what Iām talking about with aliases. If you bring in the same table twice, you need a second name so that it knows which x table it is.
This is how you copy paste. Itās literally just pasting the text, so not fancy. (and this one would actually fail, because I donāt have the correct tables in there, but you should get the point)
The copy paste is really just a half a step better than manually retyping.
One other method for this is to use Executive Queries and store you calculated value in a field in the SysCube table. Then you can pull it later into another BAQ. This might be more trouble than it is worth, depending on your use case.
Hey @NateS , Iāve never been able to figure out how Executive Queries work. Would you be willing to record and post a video that explains how you make those? (Probably in a new post).
Good Idea! I will see what I can put together. Iāll link it here when itās done.
We use executive queries and it works pretty well for our purposes. In our case we are storing a job weight calculation which is a very intensive calculation that we donāt want to repeat in so many different reports/dashboards. BUT I will say there is one major flaw - you canāt do an upsert. Trolling for votes: https://epicor-manufacturing.ideas.aha.io/ideas/KNTC-I-2824
Got it! Iāve never duplicated a table and not sure where that comes in handy. Iāll bookmark this post for the future.
Ahhh! I was trying to copy/paste everything, not just the Editor.
I really appreciate you sharing this knowledge via videos. Iām a visual learner and this helps a lot.
Usually this happens when you have subqueries. Itās common to have subqueries that are close but for some reason different, but you bring in a lot of the same tables.
I figured it was something like that, which is why I did the video.
Well ( Safe Harbor statement )
I just saw the demonstration of the new BAQ as a source for another BAQ story/idea mentioned above. IT WORKSā¦ and works wellā¦
Then I was building my own sample version, and tested itā¦ IT WORKED, and it worked well, and easy.
-
I created a BAQ that goes to calculate the unit cost for a part. This takes multiple tables. (Part, PartPlant, Plant, & PartCost)ā¦ each to retrieve necessary values to find the correct part cost (Plant to get the correct PlantCostID to get the correct PartCost record for the linked PartPlant)
-
Now that i have that āsourceā table, i am creating a second BAQ that will USE that baqā¦ This BAQ uses the Part, PlantWhse (to get the plant that the warehouse belongs to), the PartWhse (to get the QTY On Hand), and then my lower level BAQ.
The result of this is that I can reuse my source BAQ many times in multiple queries.
BUT to get this new an exciting feature, you will need to upgrade to 2023.2, AND use the new BAQ Editor in the Browser (not available in the smart client).
( Safe Harbor Statement )
What happens if you open that in classic?
Hmmā¦ not sure