Skip to Content

BusinessObjects 4.0 Using Dates For Comparison (If Then Else)

I have a date field that is in the format of DD-Mon-YYYY. How do I use that in a comparison? I want to populate a field on whether this date means a criteria.

For example, if I want to write =If[DateField]>31-Dec-1999.... what is the proper way to do that? I can't seem to find a way to include the date without the formula not validating.

Add comment
10|10000 characters needed characters exceeded

  • Which tool are you using? Web Intelligence or?

  • Sorry that I mised these replies. This is the first time I've used this new community format and I didn't get any email notifications of replies. I'll check what has been suggested. I'm actually designing the report in Webi, and this date issue has been nagging at me.

  • Get RSS Feed

4 Answers

  • Best Answer
    Oct 31, 2016 at 10:00 AM

    If this is Webi, then you can use the below syntax:

    =if(formatdate([Date Objects];"dd/MM/yyyy">"31/12/1999") then "Show" else "Hide"

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2016 at 01:48 PM

    use this.

    =if([Date Objects]>todate("31-Dec-1999";dd-Mmm-yyyy")) then "Show" else "Hide"

    Add comment
    10|10000 characters needed characters exceeded

    • The field is already a date. When I use the IsDate function on the field it returns as True. Now I need to be able to use that date for a logical comparison but I can't figure out how to write the date in the comparison.

  • Oct 31, 2016 at 03:36 PM

    what is the sample value in the date object?

    date values format?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2016 at 03:38 PM

    try like this

    =if([Date Objects]>31/12/1999) then "Show" else "Hide"

    based on the values in date object change the format of 31/12/1999

    Add comment
    10|10000 characters needed characters exceeded

    • I tried to do that originally but when I try that as follows:

      =if([Date Objects]>31-Dec-1999) then "Show" else "Hide"

      I get a message that Dec is not recognized. Luckily the FormatDate function seems to be working with my date format.