Help filtering out particular rows in a BAQ/Dashboard

ohh, that’s different. I would approach that by doing a count of records. You can count the adj records, and you can count the not adj records. (this would be 2 subqueries). Then you can join them (outer join showing all of them with adj records) and the ones that come back null on the not adj records would be the ones that you are looking for.

If you want to just add that to the one that you have, try the mini-sub method that I linked to previosly. You should be able to get a count of the non-adj records and return them on your top level. Anything with a 0 is adj-only.

Let me decompress that info in the back of my head for a bit.

I am going to create a separate query to puzzle that out.

Will get back with you on it if I get stuck.

Thanks,

Shawn

1 Like

@Banderson

OK,

I have created a separate query to understand this and I think I do.

I have a subquery that finds parts that have tranType = ADJ* and counts them
I have a subquery that finds parts that do not have the ADJ* and counts them.

I have a main query that joins the 2 subqueries and shows thepartnum and the 2 counts side by side.

The rows that have a null in the count for no ADJ are the rows that are ADJ only.

How do I use this to return only the part numbers with a null in the No ADJ column?

on your top level, in the tab on the bottom for subquery criteria, you can filter buy the value. I can’t remember if you are looking for nulls or empty string, so try both.

Edit, you can also check out an except query. This looks for when something exists in one, but not the other. They aren’t used that often, but they do what you want. Check out the help files.

@Banderson,

I tried doing a filter null constant and a filter Empty string constant.

The null returned 0 rows
The Empty string wouldn’t run. It gave: Criteria value is not defined for ‘secondTier’ table, in criteria row #1. Select filter value from the dropdown and click on links to specify filter conditions.

Am I doing something wrong here?

Can you paste a screen shot of your filter?

I have the Top Level called MainQuery
I have innersubquery called secondTier the links the next 2 queries together and gives the null fields I need.
I have innersubquery called PartsWithADJ that filters like it sounds.
I have innersubquery called PartsWithOutADJ that filters like it sounds.

Am I going about this in the wrong direction?

Ok. So technically, you can do the levels like you have, but you really can get rid of that top level you have and make the next level down the top level.

If you use the tab that says “subquery criteria” it will filter the results of that level, so you don’t need the extra level.

That being said, as far as I can tell, what you have there should work. I would have to mess with it more to see what else is going on.

A possible problem might be the filtering on an internet (or decimal) for an empty string. Since it’s not a string. Try filtering on the part number filed instead of the counted field.

@Banderson,

Hey,

I am burning my brain cells here trying to figure out how to combine these 2 queries.

One to get the results of all the parts without the ADJ listing and

one to get the parts list where it contains only the parts that contain ONLY parts with ADJ.

I am thinking union but unsure how to proceed.

Any ideas?

Thanks,

Shawn

Why would you have that in one query? Why not a dashboard with two tabs, one for each query?

If really need to to do that, you would use a union to combine those two. They just have to have the same number of fields to do so.

Check out the case study in the user guide to show you how unions work.
https://epicweb.epicor.com/Education/OnlineHelpFeatureSummary/Epicor%20ERP%2010/10.2.100/Help/enu/Standard/Tools_BAQs/CaseStudy.CombineResults.html

@Banderson,

Hey,

I built it separately and tested, thought it was fine. Randomly checked and found a record it let through that had a non-ADJ in it.

I got tired of guessing so I wrote a small Java program that takes a csv file of the raw data and spits out a csv file that returns only the partnums that contain ONLY ADJ trantypes, finds the highest tranNum and returns only the highest tranNum record for each PartNum.

It returned 5094 records.

I ran my query, it returned 7478 records.

I exported both to Excel and ran the conditional format highlight cells that contain same value on both partnum rows to find the differences.

When I did a pretty good spot check, all the records it didn’t highlight had some non ADJ records in them. The highlighted records were all good.

If I post my baq on here, think you can point me in the right direction for weeding it out correctly?

If you don’t have the time, that is fine. Anything you can do would be appreciated.

Sure. I can look at it tomorrow.

THANK YOU!!!

You are a life saver!

Here is the BAQ as it stands right now. Hopefully you can see my logic error in it without too much effort.

NonMovingInventory_190701.baq (111.7 KB)

Can you tell me what you have the date parameter doing?

Sure!

If they want to check what it looked like on a particular date, picking that date in the query tells it to ignore any records after that date. That way the calculations are based as of that day.

Does that make sense?

Did you have that set up? I didn’t see it actually being used anywhere. Just in a calculated field.

Well crap…

You are correct. I had it set up in a previous version and when I rebuilt it again looking for my error, I forgot to add that back in.

In the previous version, it was a table criteria on the PartTran table to limit the records to a certain date.

ok, so even with that date, your total on hand is only going to be the current on hand at the current cost. So it’s not a running on hand. A stock level at a certain date is a pretty tough one to calculate. And the costs are going to be the current costs. Again, a cost at a certain date is pretty tough to calculate. I just want you to be aware of that. So no matter what you do with that date parameter, the only thing it’s going to affect correctly, is the dates of the part tran table.

I’m still working on it, I will have another update shortly. While I’m doing that, can you re-explain the requirements of BAQ? Preferably something mocked up in Excel that shows what is required? I’m not 100% sure what you are after.