Oracle Analytics Cloud and Server

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

How can i compare two column values using case statement

Received Response
291
Views
3
Comments
Rank 5 - Community Champion

I am trying to write a case statement that checks If the row values in two columns meet a certain condition and if they do, to return a 1 but I don't think I have my logic right because I am getting blanks where I should be getting a 1. here is what I am trying to do:

case when "Column"  IN('Selection'

,'Hired') and  "Job Name" =" Family Name" then 1 end

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Use the "selectors" on screen to reference columns. In OBIEE a column is always referenced as <presentation table>.<presentation column>, therefore your current syntax can't match anything.

    And also: string are written with ', not " .

    "Family Name" would be a column named Family Name.

  • Rank 5 - Community Champion

    case when "AAA - "." Name"  IN('SelectION'

    ,' Hired') and "BBB"."Pattern" ="BBB"."Pattern" then 1 end. I have modified it is that clear enough to get  reponse? what did you mean by this (string are written with ', not " .)

  • "BBB"."Pattern" = "BBB"."Pattern" : what do you expect to get from this one?  You are setting a condition like 1=1

    ForSly wrote:what did you mean by this (string are written with ', not " .)

    'whatever' => this is a text value

    "whatever" => this is a reference to an object named whatever

    For example:

    CASE WHEN "Geography"."Region" IN ('APAC', 'Something Else') AND "Products"."Brand" = 'BizTech' THEN 1 END

    Capture.PNG

Welcome!

It looks like you're new here. Sign in or register to get started.