Oracle Transactional Business Intelligence

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Case When for date fields

Received Response
107
Views
2
Comments

Summary

Case when date is lesser than or equal to another date, THEN "on time", ELSE, "Not on time"

Content

I'm trying to build a Case statement that shows If one date is lesser than or equal to another, say "on time", else, say "not on time" (or some other decided upon phrase). Is that possible to do in OBIEE? Or can I only do Case statements when the the "Then" and the "Else" are other columns? Any thoughts on how to trick the column to do what I want it to do?

Answers

  • Aaron Leggett
    Aaron Leggett Rank 5 - Community Champion

    Hi Stephanie

    Yes this is possible! You would put the hard-coded value inside single quotation/apostrophe marks.

    For instance:

    CASE WHEN DATE1 <= DATE2 THEN 'On Time' ELSE 'Not on Time' END

    Kind Regards

    Aaron

  • slgott
    slgott Rank 4 - Community Specialist

    Yes! That was all that I needed. I had the statement written but was using double quotes. Thanks!