Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 28, 2016 at 03:40 PM

    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))
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 28, 2016 at 02:59 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.)

  • Dec 28, 2016 at 03:46 PM

    Hi Nick,

    Great, you found a solution!!!

    I was thinking of something similar using Case statement.

    Thanks,

    Mahboob Mohammed

    Add comment
    10|10000 characters needed characters exceeded