"Loop Operator input and output problem"

QingqiuQingqiu MemberPosts:8Contributor II
edited May 2019 inHelp
In the "Loop" operator description it says:
The output of each nested operator is the input for the following one, the output of the last inner operator will be the input for the first child in the next iteration. The output of the last operator in the last iteration will be the output of this operator.
.
while when I use it to do iterated splittings, the input is always the same for each iteration.

My purpose is just to split a data set into subset1 and 2 and then split subset1 into subset 3 and 4 and so on. The code is here:




<输出/ >
<宏/ >

<运营商激活d="true" class="process" expanded="true" name="Process">

<运营商激活d="true" class="generate_data" expanded="true" height="60" name="Generate Data" width="90" x="45" y="75"/>
<运营商激活d="true" class="loop" expanded="true" height="76" name="Loop" width="90" x="179" y="120">


<运营商激活d="true" class="split_data" expanded="true" height="76" name="Split Data" width="90" x="112" y="120">





















My expectation is that the output in iteration1 is the input of iteration 2 so after 2 iterations the output sample size should be 36=0.6*0.6*100 (100 is the original sample size,0.6 is just a ratio) while it is still 60=0.6*100. Hope I make it clear...Thanks for any help:)

Answers

  • QingqiuQingqiu MemberPosts:8Contributor II
    I tried on RM4.6 and it works. The final output sample size is 36 after two iterations. Dun know why it is different in RM5....
  • haddockhaddock MemberPosts:849Maven
    Hi there!

    I agree that the documentation is not as clear as it might be, but it may actually true! If you want to do recursion you may be better off storing, manipulating, and retrieving the dataset explicitly, like this..




    <输出/ >
    <宏/ >

    <运营商激活d="true" class="process" compatibility="5.0.0" expanded="true" name="Process">

    <运营商激活d="true" class="generate_data" compatibility="5.0.0" expanded="true" height="60" name="Generate Data" width="90" x="45" y="75"/>
    <运营商激活d="true" class="store" compatibility="5.0.11" expanded="true" height="60" name="Store" width="90" x="179" y="75">


    <运营商激活d="true" class="loop" compatibility="5.0.0" expanded="true" height="76" name="Loop" width="90" x="313" y="75">


    <运营商激活d="true" class="retrieve" compatibility="5.0.11" expanded="true" height="60" name="Retrieve (2)" width="90" x="112" y="120">


    <运营商激活d="true" class="split_data" compatibility="5.0.0" expanded="true" height="76" name="Split Data" width="90" x="246" y="120">





    <运营商激活d="true" class="store" compatibility="5.0.11" expanded="true" height="60" name="Store (2)" width="90" x="380" y="120">









    <运营商激活d="true" class="retrieve" compatibility="5.0.11" expanded="true" height="60" name="Retrieve" width="90" x="313" y="210">










    Clunky, yes, but it produces 36 examples:o


  • QingqiuQingqiu MemberPosts:8Contributor II
    Thank you haddock. It works although not as the way I thought~~~will try other methods. Thanks:)
登录orRegisterto comment.