If you are unable to create a new account, please email support@bspsoftware.com

 

DataManager - Nested IF whithin Derivation Properties of Transformation Model

Started by dcozens, 20 Jul 2012 05:44:28 AM

Previous topic - Next topic

dcozens

Hello
I'm trying to write a nested IF Statement within the Transformation model of a Derivated Column, But i cant work out what i'm doing wrong. Can someone enlighten me?

-- Basically i want the derivation of COL3/COL2. But only when COL1 is equal to 2 or 9 and when COL 2 or COL3  have are not BOTH set to zero.

IF COL1 IN (2,9) AND (COL2 = 0 AND COL3 = 0) THEN 1;
ELSE IF COL1 IN (2,9) AND (COL2 <> 0 AND COL3 <> 0) THEN (COL3/COL2);
ELSE IF COL1 NOT IN (2,9) THEN 1;
ELSE (COL3/COL2);

i'm getting an Unxespected Token error at the end of the first line (between THEN and 1 )

dcozens

I'm an Idiot!
RETURN.....

IF COL1 IN (2,9) AND (COL2 = 0 AND COL3 = 0) THEN return 1;
ELSE IF COL1 IN (2,9) AND (COL2 <> 0 AND COL3 <> 0) THEN return (COL3/COL2);
ELSE IF COL1 NOT IN (2,9) THEN return 1;
ELSE return (COL3/COL2);

t-mms

i, was an idiot too :D

thanks for this post, helped me a lot....