Categories
How can i compare two column values using case statement

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
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.
0 -
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 " .)
0 -
"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
0