on 08-26-2008 5:16 PM
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.
Hey
No UDF is required in this case,you just need to use If-Else,subString and concat standard functions.
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.