Using a formula for BAQ parameter default value?

Is there any way to apply a formula to a BAQ parameter’s Default Value?

Specifically, I have a BAQ with a date parameter which I would like to default to [Today+90 days]. But all I can do is default it to Today (edit: this is in RDD Criteria prompts, not in BAQ parameter options).

I see no ability to do this kind of a formula, yet it seems like such a simple thing, I’m hoping I’m overlooking something.

(I suppose worst-case I can change the parameter to a dropdown type, and then have a second BAQ which calculates [Today+90] date and outputs that single value. Then use that second BAQ to supply the dropdown value for the parameter in the main BAQ.)

But then you’ve basically just hard coded it, and you don’t really need the parameter anymore.

Let me play around with an updateable BAQ. I think you might be able to put a BPM on it.

1 Like

You need to use a BPM data form. If you call that on pre-processing get list then can use those values as your parameter. Once you have a BPM data form, you can make and apply a UI customization to do what you want to do. It’s ugly, and BPM data forms are buggy when moving around, but once they are in place, they work ok.

3 Likes

Ugh, yeah that seems ugly. Ok, it at least confirms that I hadn’t missed something simple, and that there is a workaround if I get desperate.
Thanks!

1 Like

Does that carry through to Kinetic BAQs or apps? You’re setting the actual parameter, so I would think yes.

I’m not sure where @tgwinn wants to use this, but I would say that if you eventually get to making a dashboard/app for it in Application Studio, you could do the magic there.

And actually, I don’t even know how you are defaulting the parameter to “today”. Can you show us how you are doing that?

2 Likes

BPM data forms don’t work well in browser (from what little I’ve done with them).

It’s really irked me that they can’t figure out how to add parameters to the trackers just like a filter. They almost got there but letting them be set by a publish subscribe, but they didn’t actually understand what we were asking.

1 Like

I haven’t had any real trouble, except they can’t be customized. :sob:

Which would make this solution moot. If you can’t customize it, then the BPM data form isn’t any better than the stock popup.

1 Like

Although I did do something weird but useful with them:

https://www.epiusers.help/t/dynamic-combo-bpm-form-proof-of-concept-kinetic-classic/103993

Right, no, it’s a whole process to make a control (combo box, date picker, etc.) for the parameter and then create a data view and then initialize a row in the view and then bind the control to the view then call the BAQ with an event and pass the parameter from the view. And don’t reference the BAQ in the grid because then you get the parameter box popping up relentlessly with that static default value.

1 Like

The default value field for a date parameter brings up a calendar date picker. There is a ‘Dynamic’ checkbox option in the RDD Criteria prompt (not the BAQ), so I’m assuming that selecting ‘Today’ in the date picker and selecting ‘Dynamic’ will always choose today’s date.
[Edited for correction of Dynamic location.]

1 Like

This BAQ is for a report (RDD+RDL).
The Criteria Set in the RDD has similar limitations to the BAQ’s parameter setup.

We’re still primarily on Classic UI, so I’m not planning on making any customizations to the report screen.

For what its worth, I ended up using the Dynamic date option on the RDD criteria prompt.
I chose the “End of Month + 3 Months” as the default to approximate a 90-day date range.
[Edited to remove reference to ‘Dynamic’ in the BAQ itself.]

But not in the actual BAQ. You keep saying that, but from what I know, there isn’t any way to set a dynamic parameter in the BAQ. Are you talking about the report parameters?

Doh! Yes, you are correct: no Dynamic option on the BAQ itself. I’ve been trying so many things, and jumping around, I got myself confused. Sorry.

ok. So I don’t know what your report does, but it sounds like number of days into the future is the most important part of the filtering? Instead of displaying an actual date for the parameters, could you just have a number for days out and then default that?

That would technically work, but its a problem for the users of the report who typically want to see the data up to, say, end of this quarter, or next 2 calendar months, etc. So, it would be clunky for them to have to manually calculate the number of days needed to target those various end dates.

Yeah, I didn’t know if it would work well or not. It really depends on what the report is for.

Here is what I do:
I use an expression like this.

/*
Default StartDate is Today
If StartDate > Today then Today
** Should we limit return data? I think so :)
If StartDate < 1/1/(Year-1) then 1/1/(Year-1)
*/
(
CASE
WHEN @StartDate IS NULL THEN Constants.Today
WHEN @StartDate > Constants.Today THEN Constants.Today
WHEN @StartDate < convert(date, convert(varchar,year(Constants.Today)-1)+N'0101', 112) THEN convert(date, convert(varchar,year(Constants.Today)-1)+N'0101', 112)
ELSE
@StartDate
END
)

For your request you should be able to edit this to fit your needs but it should demonstrate the idea.

EDIT: For the curious this was the start date of ranged dates for receipt entry data for a dashboard.

1 Like