cancel
Showing results for 
Search instead for 
Did you mean: 

Prompt for date range and which field to apply date range filter to

nick_vanlent1
Explorer
0 Kudos

I am working on a universe in the Information Design Tool, and trying to figure out how to create a prompt for the user to select a date range, and to also choose which date field to apply that date range filter to. So basically, when they run a report, they can choose to either get a set of records that were created within a date range, or get a set of records that are due within a date range. If it matters, this will be used in Crystal Reports for Enterprise. Also, we are on version 4.1 SP5.

Accepted Solutions (1)

Accepted Solutions (1)

nick_vanlent1
Explorer

I think I found a solution (again, I was over thinking it a little). I used something like this:

  • Setup a static LOV for "Date1" and "Date2"
  • Used that LOV in a parameter that prompts the user "Filter by Date1 or Date2"
  • Setup two more parameters "Select a Start Date" and "Select an End Date"
  • Created a business layer filter:

    (@Prompt(Date1 or Date2) = 'Date1' and @Select(Date1) between @Prompt(Start Date) and @Prompt(End Date))
    or
    (@Prompt(Date1 or Date2) = 'Date2' and @Select(Date2) between @Prompt(Start Date) and @Prompt(End Date))

Answers (2)

Answers (2)

mhmohammed
Active Contributor
0 Kudos

Hi Nick,

Great, you found a solution!!!

I was thinking of something similar using Case statement.

Thanks,

Mahboob Mohammed

mhmohammed
Active Contributor
0 Kudos

Hi Nick,

Try this blog, you'll have to update the logic a little bit though. Let us know if you need help in updating it.

Custom Predefined Date Range Filters in BO Universe

Thanks,

Mahboob Mohammed

nick_vanlent1
Explorer
0 Kudos

It doesn't look like that blog will apply. It is filtering a single "table.date" field. For me, however, I would like to filter on either "table.date1" field or "table.date2" field, depending on which option the user selects. So there will be two prompts: one for date range, and one for the user to choose "Date1" or "Date2". (Actually, three prompts, because the date range will have two prompts; one for start and one for end.)