BIP - Prompt

Dynamic Default Value when no prompt is selected

Default Dynamic Parameter

When no prompt is select, you can send as parameter value a NULL.

With this possibility, you can create a query which will default to for instance the max week code of your fact table.

AND date.week_code <=
    (SELECT NVL(:prWeekCode,MaxWeekCode)
    FROM
      (SELECT MAX(date.week_code) AS MaxWeekCode
      FROM fact,
        date
      WHERE fact.date_id = date.date_id
      )
    )

Default Dynamic Periode

If you want to define a default period, you must write an SQL above this SQL to get an interval such as:

  AND date.week_id >=
    (SELECT max(week_id) -1
    FROM date
    WHERE week_code =
      (SELECT NVL(:prWeekCode,MaxWeekCode)
      FROM
        (SELECT MAX(date.week_code) AS MaxWeekCode
        FROM fact,
          date
        WHERE feit.date_id = datum.date_id
        )
      )
    )

Powered by ComboStrap