Skip to Content
author's profile photo Former Member
Former Member

Concat UDF in mapping Question

All,

I have this requirement:

hi experts,

I have a question in mapping,

Can some1 help me pls:

Scenario: Input to UDF will be 2 Queues Q1 and Q2,

Q1 to hold true/false value

Q2 to hold actual values that need to be passed to target.

1. output should be produced from Q2 depending on the condition @ Q1 as described in the sample below:

q1 | q2 | OUTPUT

________________________________

1 True |JFK |JFK

2 True |Intrnl |Intrnl

3 True |Airport |Airport Drive

4 False |Drive |NY 98787 country

5 True |NY |blablabla

6 False |98787 |

7 False |country |

8 True |blablabla |

Basically look @ Q1 if we have a true followed by a true then put values of Q2 in a separate line in OUTPUT.

If True is followed by 1/more number of False then the values corresponding to that in Q2 should all be concatenated.

Please help me out guys,

I have actually begun coding the UDF but nt able to debug this correctly and facing issues.

Thanks,

Hank

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2009 at 05:29 AM

    U mentioned how it behaves if true followed by false... fine....

    but,

    Can u please mention how the concatination will occur if

    false followed by false

    and

    false followed by true.

    So then some one can give u the code.. corresepondingly..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2009 at 03:57 AM
    Q1 to hold true/false value
    Q2 to hold actual values that need to be passed to target.
    1. output should be produced from Q2 depending on the condition @ Q1 as described in the sample below:

    Your UDF will have many if statements:

    if (q1 = True & q2 = JFK)

    {return q2;}

    if (q1 = True & q2 = Intrnl)

    {return q2;}

    And so on for each of your 8 conditions......in the last three conditions are you not passing any value to output?

    The UDFsample shown above is just for your understanding.....it will need formatting.

    Regards,

    Abhishek.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2009 at 05:07 AM

    I did not understand your requirement clearly.

    Will you explain this more clearly

    Basically look @ Q1 if we have a true followed by a true then put values of Q2 in a separate line in OUTPUT.
    If True is followed by 1/more number of False then the values corresponding to that in Q2 should all be concatenated.
    
    

    .how does the values are getting populated in OUTPUT

    q1 | q2 | OUTPUT
    ________________________________
    1 True |JFK |JFK 
    2 True |Intrnl |Intrnl 
    3 True |Airport |Airport Drive
    4 False |Drive |NY 98787 country
    5 True |NY |blablabla 
    6 False |98787 |
    7 False |country |
    8 True |blablabla | 
    
    
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.