While creating Webi reports some users always have a requirement for the display of Begin Date and End Date in the Report Header or Page Header. We can achieve this by the Built in functions of Web Intelligence like UserResponse().
For e.g. If the user wants Transaction Start Date and Transaction End Date in the Page header of the report I would create something like this.
Drag and Drop a blank cell in the report and use the below formula in it:
="Transaction Date Between "+UserResponse ("Enter Trx Start Date")+ " and "+UserResponse ("Enter Trx End Date")
This would display the Start Date and End Date in the report but it would not remove the timestamp from the date which comes by default.
What if I want to format my Date as per my choice and display only the Date. I would make use of the date formatting function called FormatDate(). In order to remove the timestamp I will have to user ToDate to convert the character date format to a desired Date format.
Below formula would achieve this
= "Transaction Date: " + "between"+ FormatDate(ToDate(UserResponse("Enter Trx Start Date") ;"MM/dd/yyyy hh:mm:ss A"); "MM/dd/yyyy") +" and "+ FormatDate(ToDate(UserResponse("Enter Trx End Date") ;"MM/dd/yyyy hh:mm:ss A"); "MM/dd/yyyy")
and the date prompt would look better.
For e.g. If the user wants Transaction Start Date and Transaction End Date in the Page header of the report I would create something like this.
Drag and Drop a blank cell in the report and use the below formula in it:
="Transaction Date Between "+UserResponse ("Enter Trx Start Date")+ " and "+UserResponse ("Enter Trx End Date")
This would display the Start Date and End Date in the report but it would not remove the timestamp from the date which comes by default.
What if I want to format my Date as per my choice and display only the Date. I would make use of the date formatting function called FormatDate(). In order to remove the timestamp I will have to user ToDate to convert the character date format to a desired Date format.
Below formula would achieve this
= "Transaction Date: " + "between"+ FormatDate(ToDate(UserResponse("Enter Trx Start Date") ;"MM/dd/yyyy hh:mm:ss A"); "MM/dd/yyyy") +" and "+ FormatDate(ToDate(UserResponse("Enter Trx End Date") ;"MM/dd/yyyy hh:mm:ss A"); "MM/dd/yyyy")
and the date prompt would look better.
No comments:
Post a Comment