cancel
Showing results for 
Search instead for 
Did you mean: 

How to use like operator in IFTHENELSE (BODS)

Former Member
0 Kudos

Hi All,

I want to find the value of  ' % ASSOC%' in the name and replace it to 'Assoc.' using ifthenelse.

Can any one help me. Is there any similar fuction as LIKE operator. Can we give LIKE in ifthen else condition.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member186897
Contributor
0 Kudos

Hi,

This is easy in BODS, you can code like this:

ifthenelse

(

Table.field_name like '%ASSOC%',replace_substr( Table.field_name,'ASSOC','Assoc.')

,Table.field_name

)

Regards,

MSA

Answers (4)

Answers (4)

Former Member
0 Kudos

I think we can use Decode statement too

decode(Table.field_name like '%ASSOC%, 'Assoc.' , ,Table.field_name)

former_member189153
Active Participant
0 Kudos

Hi,

try search_replace function  It will searches input parameters and replaces by matching criteria and values.

akhileshkiran
Contributor
0 Kudos

Hi ,

if you have data ASSOC1,ASSOC2

and you want Output like Assoc.1,Assoc.2.

In this condition it is not possible with ifthenelse function

it will return output as Assoc.

Example Source:

If we use if then else condition. Then it will replace all the Data to Assoc. 

Or else if you want to replace ASSOC to Assoc. Then you can use Search_Replace also

it will generate a XML script

The expected output as follows in the below screen. As per your requirement you can you any one of this.

Regards,

Akhileshkiran.

akhileshkiran
Contributor
0 Kudos

Hi

Please close the thread if you find Answered/Helpful

So that it can help other to find out the answer easily.

Regards,

Akhileshkiran.

Former Member
0 Kudos

Hi,

Try this one

ifthenelse( TGT_ANSWERCODE.OLD_CODE like '@AE','PASS','FAIL')

Regards,

Manoj.