BAQ Help

Hi Guys,

I have a BAQ written to track the last po dates for parts from suppliers, I have a criteria in Vendor table for only returning 1 vendor, this was jsut so I could verify data from the BAQ, once I was happy with that I removed the criteria but am no getting 0 rows returned and not sure why.

With Criteria:

Without Criteria:

Query Phrase:

It looks like you are returning a lot of data and it can’t quite get it all before it times out. You can extend the BAQ processing time by going to Actions > Execution Settings > Add a Timeout field and increase the value until you get results.

2 Likes

Hi,

I did that but it still times out, i incresed it to 1000, that didnt work and then I put it as 0 and still doesn’t work.

Would you be willing to post a copy of your BAQ here?

Of course.
Supplier_Item_List.baq (58.6 KB)

This BAQ runs fine in my database. I am guessing you just have a lot of POs, parts, and vendors. Try sending your BAQ to a dashboard so you can run it wide open without any timeouts. To see how many records you are working with, you can run the BAQ for each vendor individually. perhaps it is only one vendor that has the bulk of the records, and by filtering that one out you might be able to get some results. Either way, running it wide open in a dashboard should at least get you some results.

Also, sometimes you just have bad luck. I know.

There’s a hack called OPTION(RECOMPILE) that you add to OrderBy. It made this BAQ literally 100x faster:

The way this works (says the novice) is that OrderBy can be specified with a numeral representing the field to sort by.

So if you already sort by column 1, then 1 OPTION(RECOMPILE) doesn’t change anything. But if you sort by column 5 then 3 then 4, and you still use 1 OPTION(RECOMPILE) you will find that your precious sorting is lost. You’d have to recreate the logic with numbers. (I think it’s comma separated?)

But first, ignore all that and just give it a whirl and see if it runs faster.

1 Like

Thanks Nate, I got it working putting it into a DB.

1 Like

One other trick… try turning your query on the PO tables into a CTE query. Why? Because if you do, then I believe it will run this query ONE TIME and build a working table… then it will use this CTE as a datasource. The way you have it working right now, every time it finds a new part, it will rerun the query which inefficient.

1 Like