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.)
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.
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.
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.
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.
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.]
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?
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.
/*
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.