cancel
Showing results for 
Search instead for 
Did you mean: 

Exists function

Former Member
0 Kudos

Hi All,

My requirement is souce field format(MM/dd/YY) convert it to target field format(dd-MM-yyyy). I used Date Trans function to achieve the same. The problem is some times the source field may not contain any value. So, I tried exists function some thing like this.

src>exists>input to if functon

src>dateTrans>input to then part of if function.

constant(blank)-->input to else part of if function

Output of if function-->target field.

The problem here is if the the input field is empty, again it is exeuting the DateTrans function and error"Unparsable date".

Pls let me know where I am going wrong...

Thanks & Regards,

Jai Shankar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please add additional condition which will check if source field is blank.

(src>exists) and [not (src equals "")]>input to if functon

src>dateTrans>input to then part of if function.

constant(blank)-->input to else part of if function

Regards,

Wojtek

Former Member
0 Kudos

Wojtek ,

Thanks for the timely help. I guess only

src equals ""-->input to if functon should do it in my scenario since the occurance of the node is 1..1

Thanks a lot,

Regards,

Jai Shankar.

former_member206604
Active Contributor
0 Kudos

Hi,

Yes if you have occurance 1..1 you just need to check for "" blank value thats enough.

Source             Source
                    
        Equals-->IfWithElse-->Target
       /              /
Constant("")        Constant("")

Regards,

Prakash

Former Member
0 Kudos

Thanks Prakash. I have used the same design you gave. It works good...

Thanks & Regards,

Jai Shankar

Answers (1)

Answers (1)

moorthy
Active Contributor
0 Kudos

Hi,

Check out If-with-Else logic funtion and in the else part pass just constant value as Prakash mentioned.

Also alternative way is to do user defined java function as you know.

Regards,

Moorthy

Former Member
0 Kudos

UDF will be a bit complex, since I have to do the date transformation manually... Graphical mzpping wil do it in my case.. Thanks for the helping hands...

Thanks & Regards,

Jai Shankar.