Complex logic
Moderators: chulett, rschirm, roy
Complex logic
I have an input file
Last edited by umamahes on Wed Jun 27, 2007 9:54 am, edited 2 times in total.
HI
Re: Complex logic
You can use a stage variable in a transformer to hold the parent value.
If you define the stagevariable svParent as:
The value of this variable will change if a new parent record is found, and stay the same if child records are found.
Then you can use this stage variable to load the first column in the output.
If you define the stagevariable svParent as:
Code: Select all
if IsNull(indata.Col1) then indata.Col2 else svParent
Then you can use this stage variable to load the first column in the output.
Last edited by JeroenDmt on Wed Jun 27, 2007 1:19 am, edited 1 time in total.
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Also add the constraint NOT(IsNull(indata.Col1)) in transformer ![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Is this multi-level? Would you need to generate complete hierarchies, such as 1 2 3 4 5 6 ? That would add a deal of complexity (recursion), but could be solve using a carefully-designed hashed file and the little-known WITHIN query.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.