cancel
Showing results for 
Search instead for 
Did you mean: 

how to delete target field in graphical mapping

Former Member
0 Kudos

Hi all,

i have a field called failedsubject in my target my requirement is if their is no value in this field then it has to be deleted means it should not be shown iam using graphical mapping. please help me

thanks in advance

Accepted Solutions (0)

Answers (4)

Answers (4)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Check marks at the source using if and constant function( pass value here) and based on the output result use createif to create target structure. Very simple.

Former Member
0 Kudos

my source structure is

subject (node)

subjectname

marks

and my target structure is

total

result

failsubject

marks

condition if the marks greater than 50 in all subjects then the fields in the target structure failsubject and marks should not come

and i want it without using udfs

Former Member
0 Kudos

Have you simply tried below mapping?

if Marks < 50 than map subject ---> FailSubject

if Marks < 50 than map Marks ---> Marks

The FailSubject and Maks will be created only then the Marks is < 50.

Shweta.

Former Member
0 Kudos

Make sure the occourance for field failsubject is NOT mandatory. ( 1 to 1).

Use following mapping.



SubjectMarks --> greater than -->Remove Context -->createif -->sort (Descending Order) -->Collapse Context -->FailSubject

Contsant (50)

Regards,

Gouri

PriyankaAnagani
Active Contributor
0 Kudos

Hi,

Please try with the below logic.

public String failedSubject(String sub1, String sub2, String sub3, Container container) throws StreamTransformationException{

if (Integer.parseInt(sub1) >= 40) //assuming 40 as passmark

if (Integer.parseInt(sub2) >= 40)

if (Integer.parseInt(sub3) >= 40)

return false;

else

return true;

else

return true;

else

return true;

}

failedSubject---->ifWithoutElse-->failedSubject

pass all subjects as input to the UDF.

Regards

Priyanka

Edited by: priyanka.anagani on Sep 16, 2011 3:26 PM

former_member854360
Active Contributor
0 Kudos

Hi,

Map with ifwithoutelse condition in graphical mapping

If source ------>equals(blank)------------>Not------>ifwithoutelse----------->Target
                                                       source------->

Former Member
0 Kudos

in my source structure i have fields called marks, subject and in my target structure i have a field called failedsubject if pass in all subject then the feild failsubject should not appear in target structure this is my req

Former Member
0 Kudos

How you will know if pass or fail?

Is it based on Marks???

If Yes, use below mapping,

Marks > (Greater Than) 40 (For E.g.) --> createif failedsubject

For More Details, plz provide source and target structure.

Regards,

Gouri

Former Member
0 Kudos

Hi,

Here you can write a UDF where Marks and Subject (Remove Context) will be input to it.

Logic would be to loop on each subject and its mark and check if all subjects are passed. If not, set a flag and pass it as output of the UDF. Now take this output, put ifelse condition and either create or suppress target field failedSubject based on your ifelse condition.

Regards,

Amol

Edited by: AMOL BHARTI on Sep 16, 2011 3:14 PM

Former Member
0 Kudos

Use CreateIF Function.

Regards,

Gouri