Calculated Default Value for a Prompt

It is possible to specify a constant default value for a prompt. But what if the default value need to be calculated.

For example, there should be an optional prompt for the statement date in the report. If the date is not specified by the user, the current date should be used.

It is possible to implement the logic with the following query filter:

If the date is not specified in the prompt, the optional prompts are ignored and the condition will be reduced to:

Statement Date Equal to Today

If the date is specified, the condition will be equivalent to:

Statement Date Equal to Prompt "Enter Statement Date"

because

A or (A and B) <=> (A and True) or (A and B) <=> A and (True or B) <=> A

9 thoughts on “Calculated Default Value for a Prompt

    1. dmytro Post author

      Both should be optional

      In general, if there are two prompts with the same name, you should set identical properties to them.

      Like

      Reply
    1. dmytro Post author

      You have to create the corresponding object in the universe.

      For SQL Server, the select statement for the object will be: CAST(GETDATE() AS DATE)

      Like

      Reply

Leave a comment