I’ve created a BAQ report to show jobs based on the criteria that the Jobs are due within 2 dates. I’ve created Option Fields for the due date so the user can select these 2 dates.
Now the need has arisen for the user to be able to filter the results based on whether the Jobs are Open, Closed or to display all.
I’ve tried a few methods but with no luck. The method I’m trying at the moment has an nvarchar Calculated Field that contains an nvarchar parameter. This Calculated Field is used in the Option Field. I’ve customised the field to display a drop down with values instead of a text box.
If the user selects ‘Open’ then it should display only Open Jobs.
If the user selects ‘Closed’ then it should display only Closed Jobs.
If the user selects ‘All’ then it should display both Open and Closed Jobs.
As you can see below, I’m using the Calculated column result in the WHERE clause. I know that normally you don’t need to use an Option Field in a WHERE clause, so I’m a bit unsure how to proceed.
and (JobHead.JobClosed = (case
when IncludeClosedJobs = 'Closed' then 1
else 0
end) or JobHead.JobClosed = (case
when IncludeClosedJobs = 'Open' then 0
else 1
end))
While it’s a valid option, it’s an annoying way to set it up for the user. If you check both check boxes, you get none, as well as the fact that you can’t easily default a checkbox to true when the dashboard opens up. Most users will immediately hit refresh before adding any filter, running the BAQ wide open and running returning every job you have ever done will now make them wait for that to load. Using the drop down hack, you can default the selection to open jobs so, which is what they are going to want a majority of the time anyways.
The question is for BAQ report and in report options the date fields always default to today’s date so you will get all jobs for today’s date only and no risk of getting a large data returned by the BAQ report.
However, dashboards are always better option and we always discourage reports.