Page 1 of 1

PX Transformer Constraint Otherwise Not Working Correctly

Posted: Thu Sep 12, 2013 10:59 am
by jweir
Hello all,

It seems my constraints on my transformer are not working correctly (or the way I think it should work).

Say for my input, I have 1000 records. I have five output links from my transformer. Below are the four constraints. The other output link is the Otherwise.

Code: Select all

 C1 = Len(Ln_ds_src.SBB) <> 4 Or
 AlNum(Ln_ds_src.SBB) = 0

C2 = Ln_ds_src.Date < '2000-01-01'

C3 = Ln_ds_src.NumberId = 'UNKNOWN'

C4 = Len(svCIIcheck) < 6 And svSTSalphanum = 0

C5 = Otherwise
Out of the 1000 records, 68 get passed to the C4 output link. However, all 1000 records are being passed to the Otherwise link.

Can anyone shed some light as to why this would be happening and how I can resolve this?

Thanks in advance.

Posted: Thu Sep 12, 2013 4:25 pm
by ray.wurlod
Only the obvious observation that none of your records meet any of the critera on the first four constraints. You would need to provide values of the tested fields in order for us to decide that one way or the other.

Posted: Thu Sep 12, 2013 6:33 pm
by jweir
Thanks Ray.

However, there are records that are meeting my criteria. If you re-read above, there are 68 records that get passed to by C4 constraint. Also, all 1000 records get passed to the Otherwise link. So it seems that some records are going down two output links.

Posted: Thu Sep 12, 2013 7:25 pm
by ray.wurlod
Check the output link execution order. Is the Otherwise/Log link being executed first?

Posted: Fri Sep 13, 2013 7:02 am
by jweir
Ray,

It is not the first, but it is the second condition when I open the constraints window. I am not sure how to move the order of constraints around, but I will figure it out and put the Otherwise last and see if that works.

Thanks.

Posted: Fri Sep 13, 2013 7:31 am
by jweir
Ray,

You are correct. The reason I was getting double matches was because the Otherwise link was second in order of execution. I moved the Otherwise link to last (by simply detaching and re-attaching the link to the transformer) and it ran with correct number of outputs.

I guess it never hit me that order of execution applies to constraints too.

Thanks! Marking as resolved.

Posted: Fri Sep 13, 2013 5:33 pm
by ray.wurlod
There is a Link Execution Order tool in the Transformer stage toolbar.