TurboIntegrator Process

Post Reply
mhackTM1
Posts: 3
Joined: Fri Jun 22, 2012 6:41 am
OLAP Product: IBM Cognos TM1
Version: 9.5.2
Excel Version: 12

TurboIntegrator Process

Post by mhackTM1 »

Good day everyone! I just want to ask something about parameter in TurboIntegrator process. I have a parameter vNewYear and the user will input a year (eg 2013) However, I'm experiencing difficulty in the input. I want the user to input number only, regardless of length because I used the SUBST to get only the first four of the input. Here's the problem, the user can also input letters for year (eg abcd) and it will be added to the dimension element. I don't want the letters to be part of the dimension because it is intended for years only (eg 2012, 2013). May I know the syntax for this? example, if the user inputs 'ab2013' the process will not take place. '20bc13' the process still will not take place. '2014abc', the process will only get 2014 (given). Thank you in advance :)
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: TurboIntegrator Process

Post by rmackenzie »

The NUMBR function might be the one to use here as it will ignore non-numeric characters in the input. E.g.

Code: Select all

nTest1 = Numbr ( '20ab32cd' );
nTest2 = Numbr ( 'abcd');
nTest1 will be 2032, and nTest2 will be 0. So, perhaps your Prolog code should read:

Code: Select all

nLength = LONG ( vNewYear );
IF ( nLength < 4 );
  # can't have given a correct input?
  ProcessError;
ENDIF;
sFirstFourChars = SUBST ( vNewYear, 1, 4 );
nYear = NUMBR ( sFirstFourChars );
IF ( nYear < 2000 );
  # can't be a good input
  ProcessError;
ENDIF;
# carry on with nYear
Robin Mackenzie
mhackTM1
Posts: 3
Joined: Fri Jun 22, 2012 6:41 am
OLAP Product: IBM Cognos TM1
Version: 9.5.2
Excel Version: 12

Re: TurboIntegrator Process

Post by mhackTM1 »

Thank you for your response Sir. This will help :)
Post Reply