Skip to Content
0
Former Member
May 07, 2016 at 04:07 AM

Report Variable logic to compare two fields and display as match or mismatch

1622 Views

Hi All ,

I have a scenario where in i need to compare data of two columns. Both columns are Strings.

below are the scenarios to be covered


Column1 Column2 output :is it a mismatch? AAA Yes AAA Yes AAA AAC;AAA; AAB No AAA AAA No No


Scenario 1 : if column 1 has a value and Column 2 is NULL = its a Mismatch

Scenario2 : if column 1 is NULL and Column 2 has a Value = its a Mismatch

Scenario 3 : if column 1 has a value and its found in Coulmn 2 (any position in set of strings) =Not a Mismatch

Scenario4 : if column 1 value matches with Column 2 value= its not a Mismatch

Scenario 5: If both columns are NULL = its not a mismatch

Note : I have tried to achieve the above scnerios by creating a report level variable and have defined as below

if (IsNull([column1)) then "Y"

else

If(Match([column1];"*[column2]*");"Y";"N")

The above logic holds good for scenario 2,3,5 but do not cover the rest

I use SAP BusinessObjects BI Platform 4.1 Support Pack 6 Patch 4

Version: 14.1.6.1848

http://www.sap.com/bi

Can anyone please assist

Thanks,

Chaithra M.R