ARIJ HK Posted May 19, 2021 Posted May 19, 2021 Hello , i have 3 columns col 1, col 2, col 3 and i want to add and to calculate col X : col1 col2 col3 COL X client1 v1 v1 exist client1 v2 v1 not exist client1 v1 v4 exist if value ( col2 ) exist in (col3) than exist else not exist => over client 1 i cannot apply this : if col 2 = col 3 then "exist" else "not exist" because in rows 2 and 3 i will have as result not exist or in row 3 : V1 exist in col3 please help me to find a solution thank you
Gaia Paolini Posted May 20, 2021 Posted May 20, 2021 is the colX you show the desired result In that case they should all be 'exist' because over the client1 there are cases in which col2=col3. I have the impression, from the way you describe it, that this is a stepping stone towards a goal (adding values) maybe you can elaborate
ARIJ HK Posted May 20, 2021 Author Posted May 20, 2021 Hello, the objective is to calculate the colX : For each customer if the value in column 2 exists at least in onerows of column 3 then we write in column X "EXIST"else "not exist" in this example : col1 col2 col3 COL X client1 v1 v1 for the client 1 : v1 exist in col 3 so : exist client1 v2 v1 for the client 1 : v2 not exist in col 3 : not exist client1 v1 v4 for the client 1 : v1 exist in col 3 : exist
Gaia Paolini Posted May 21, 2021 Posted May 21, 2021 Would this work CASE WHEN RXExtract(Concatenate(' ',Substitute(UniqueConcatenate([col3]) over ([col1]),',',' '),' '),Concatenate(' ',[col2],' '),1) is not null then 'exist' else 'not exist' end
ARIJ HK Posted May 21, 2021 Author Posted May 21, 2021 Yes it works thank you for your help Best regards,
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now