cancel
Showing results for 
Search instead for 
Did you mean: 

One input Two outputs required with UDF !!

Former Member
0 Kudos

HI Guys,

Plese give me some ideas how to write a UDF, with one input value (true) and return two answers "True" and "False".

any inputs about this please?

Regards

San

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use the following UDF code and map ur input as shown below.


input---->removeContext------>UDF---->Output.

UDF code(select "All values of Context" while creating UDF,and name of the input parameter is "input")


for (int i=0;i<input.length;i++)
{
If(input<i>.equals("True")
{
result.addValue("True");
result.addValue("False");
}
else
result.addValue(input<i>);
}

Answers (1)

Answers (1)

Former Member
0 Kudos

Please Brief , what is your actual reqt ... ?

Former Member
0 Kudos

Hi

I am getting four values in one queue, like true,true,false,true. If true comes in I need to produce two values like true and false, in case if false comes in any instance only one output false has to come out.

in short with that four values i need to produce 6 outputs. is it possible ??

Many Thanks

Regards

San

Former Member
0 Kudos

I think you can do this graphicaly , there is no need to use ..... UDF

What i understand is , you reqd. a

FALSE , TRUE ,FALSE , FALSE -


> for these two .... on the basis of that by using graphical mapping -


> You can get DISTINCT VALUES i.e result would be a queue contains ... TRUE , FALSE .

FALSE , FALSE ,FALSE , FALSE -


> for these two .... on the basis of that by using graphical mapping -


> You can get DISTINCT VALUES i.e result would be a queue contains ... FALSE only

TRUE, TRUE, TRUE, TRUE -


> for these two .... on the basis of that by using graphical mapping -


> You can get DISTINCT VALUES i.e result would be a queue contains ... TRUE only

am i understanding right ..if yes.... I will let you know the GRAPHICAL NODE FUNCTIONS

regards

Prabhat Sharma

Former Member
0 Kudos

INPUT - REMOVECONTEXT - SORT - SPLIT BY VALUE( VALUE CHANGE) - COLLAPSE CONTEXT - OUTPUT

This will return , the Distinct value .....

You can use it as hint , modify it as ur reqt.

Hope this help..

regards

Prabhat Sharma,

Former Member
0 Kudos

Hi Prabha,

My requirement is i m getting output as True,False,True,False like this. I need to take this output as input and need to produce output like True,False,Flase,True,False,False. If True comes in need to produce True,Flase like this.

Thanks

San

Former Member
0 Kudos

Use UDF with queue. You can return values in a queue. In your UDF code, you can insert true and false for every true that you are getting. Form the queue accordingly.

Former Member
0 Kudos

Hi Expert,

I know that part, could you please help me in UDF code !!!

Thanks

San

Former Member
0 Kudos

Sorry, I can give you logic but you have to write the code. I can't spoon-feed you. Best of luck!