Working With Date Parameters in a Tracker

I created a BAQ that simply takes all of our part numbers (grouped by part) from the [OrderDtl] table and adds 3 calculated fields to determine total orders, total quantity from those orders and the last date for which the part was ordered. Fairly straightforward. I tested the BAQ to make sure that all of these calculated fields adjusted as expected when a start and end date were given (which narrowed the scope of returned records by [OrderHed.OrderDate]).

So, if I parameterized with a start date of 01/01/2018 and an end date of 12/31/2018 – then I had better not see a “last ordered” date greater than 12/31/2018; and certainly, total orders and quantities that are much lower as compared to the entire history of the company’s overall sales.

The client requesting this prefers to have it in a tracker where he can simply select the start and end dates as filters and then refresh it to see the results. However, I’m having some difficulty working with the dates – because as soon as dates enter the BAQ as hard data points (so the tracker can use them), the BAQ wants to group on them, which I can’t do, of course.

Here’s what I’m dealing with:


How might this be addressed to allow a tracker to use the date parameters without affecting the [OrderDtl.PartNum] grouping currently set in the BAQ?

I think your tracker parameters need to be applied to raw dates (not the calculated ones).

If the BAQ only returns the Calculated date, you can only filter on the BAQ results, not the source data for the BAQ

I have not included dates in the BAQ because as soon as that happens, the BAQ is expecting me to group on that data point… which can’t happen, because I don’t want to return total orders and total quantities by all possible dates in the [OrderDtl] table. I only want to see these values by [PartNum].

I can do this pretty easily in SQL:

image

When I don’t use the date parameter, I get the total history of sales for all parts. When I introduce a date parameter, I can see (as in the example above), sales totals for everything starting Jan 1st of 2019.

In a tracker situation, I can’t do this (because it expects a date field to parameterize on – and then the underlying BAQ wants to group off of that date).

1 Like

But am I right in what you’re trying to do?

If your range is 1/1/2018 to 12/31/2018, you only want records in that range included in your calculations. With the calculation being MAX(OrderDtl.NeedBy) (as an example)

So the source data of

image

With a desired criteria of 1/1/2018 to 12/31/18 should give

image

That’s exactly correct. You have your date range parameters limiting everything to 2018… therefore, you should only have returned calculated criteria on records associated with 2018 — precisely as you have it in your example.

Just to be clear… I can get this accomplished with a parameterized BAQ.

Example:


But… it seems to fall apart for me when trying to convert it into a tracker-controlled solution.

If we could just pass parameters to a BAQ from a Dashboard …

So… the tracker merely filters data fed by the BAQ, but cannot parameterize the BAQ… correct?

(Essentially rendering my idea DOA… ?) :sob:

Was it over when the Germans bombed Pearl Harbor?

2 Likes

That feels like an Animal House quote that… oddly… has interesting merit in the corporate world.
(I almost want to flag that as a solution) :rofl:

Is using BAQ Parameters out of the question? It is a pop-up, that looks like a hacked-in solution, but would get the job done.

Definitely not out of the question. We can only work within the limitations of the system. So, I’ll need to explain the situation and let the client know that the parameterized BAQ is the only way he’s going to be able to pull back the data he requires in the manner he wishes.

Thanks for all the feedback, Calvin. Your input is always terrific.

I’m not going to go gently into that night. I’m try various methods. I’ll come up with a solution, but it will be worse than using the Parameters :slight_smile: