cancel
Showing results for 
Search instead for 
Did you mean: 

Function

Former Member
0 Kudos

Hello sdn folks

I need help in a udf

Source:

AB

CD

PO

Target

A

D

@PO

Logic:

If source is AB then output is A ( extract first letter)

If source is CD then output is D( extract scond letter)

Else output is @PO( Concatenate @ and the source)

So we have rules for only AB and CD and for any other value you should concatenate.

If I could get a screenshot and the udf ,I would appreciate it,.

Thank You.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

No UDF is required in this case,you just need to use If-Else,subString and concat standard functions.

Thanx

Aamir

Former Member
0 Kudos

There are many source values ,so the whole screen looks messy in case I dont write the udf.

Thank You

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

U can use Fixed value mapping.

Input to value mapping function

AB

CD

PO

output

A

D

@PO

and map the output to target.

chirag

Former Member
0 Kudos

Chirag

The eg i used is specific and not generic

IF i use fix value mapping ,I have to use not only for PO but for any value besides AB and CD.

I mean IF I have ZZ then output should be @ZZ and not @PO

Thank You

Former Member
0 Kudos

HI,

I think if u have many condition like this then many Ifthen substring n concat will be used n which will increse ur mapping

Again u go for UDF then again if then else loop will also increase.

Can u tell me how many inputs condition u have form source.

if u have 10 source value to be checked then u can make entry of 10 inputs in fixed value mapping n use that.

chirag

Former Member
0 Kudos

Chirag and All

Ideally the solution I am looking for is :

There is a default in Fix value mapping

I can put a @ in Default.

now I want a UDF which if the output of fix value is default ,concatenates the @ and the source value ( Generic) ,I am not sure any combination can occur.

ELSE

Pass the fix values correct answer : I mean if Source is AB then map A.

I hope you understand what solution I am looking for.

Thank You

Former Member
0 Kudos

Wat i understood from ur requirement is

u have certain sets of input value which is coming from source.

if ur input value is AB then output is A if its CD then output is D

Can u tell me ur input soruce strucutre n output strucutre and input value n output value.

if u can provide the XML then its well n good,

chirag

Former Member
0 Kudos

Input

AB

CD

ZZ

AA

BB

.

.

.

Input can be any combination of letters but we are only going to have mapping logic for AB and CD

Target

A(Extract first letter)

D( Extract second letter)

@ZZ

@AA

@BB

If input is anything besides AB and CD then concatenate the @ and source value since we are only concerned with logic for AB and CD.

Does it sound clearer now? Fix values is fine for AB and CD since we know that answer is A and D respectively but for any other permutaion of letters answer should be CONCATENATION of @ and source combination of letters.

Thank You

Former Member
0 Kudos

Thanks guys for trying to help out ,I accomplished what I was asking using some boolean and node functions.

Giving the points to Aamir and Chirag.

Thank You