glittle
Posts: 5 Joined: Fri Apr 25, 2014 12:18 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Post
by glittle » Mon Jul 21, 2014 5:08 pm
Hello
I have a quick question; is it possible to use nested WHILE loops in Turbo Integrator?
This post implies it is...
http://www.tm1forum.com/viewtopic.php?f=3&t=348#p16842
... but when I try to run this process as a test:
Prolog:
Code: Select all
#****Begin: Generated Statements***
#****End: Generated Statements****
x = 1;
y = 1;
WHILE ( x <= 12);
WHILE ( y <= 12);
ASCIIOutput('D:\TM1\Files\TimesTables.csv' , NumberToString( x) | ' times by ' | NumberToString( y) | ' is ' | NumberToString( x * y) );
y = y + 1;
END;
x = x + 1;
END;
I get the attached output...
TestOutput.png (6.18 KiB) Viewed 5514 times
declanr
MVP
Posts: 1831 Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:
Post
by declanr » Mon Jul 21, 2014 5:19 pm
Yes its possible.
The reason you don't get multiple loops through the output is you're failing to reset your inner counter back to 1 for further passes.
Declan Rodger
glittle
Posts: 5 Joined: Fri Apr 25, 2014 12:18 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Post
by glittle » Mon Jul 21, 2014 5:25 pm
So I'm not.
Thanks for the fast response.
FragaA
Posts: 1 Joined: Mon Feb 23, 2015 4:16 am
OLAP Product: Cognos TM1
Version: 10.1
Excel Version: 2010
Post
by FragaA » Mon Feb 23, 2015 4:22 am
declanr wrote: Yes its possible.
The reason you don't get multiple loops through the output is you're failing to reset your inner counter back to 1 for further passes.
Resetting the counter was certainly the solution to our own issues with the while loops. Thank you very much for this.