turbo integrator rule

Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: turbo integrator rule

Post by Alan Kirk »

angel1234 wrote:hi,

can you please tell me is this the correct syntax of ascii output statement??

asciioutput('F:outputext.txt',dayno(attrs('storename1',type,'startdate');

and please tell me in which tab i should write the statement in advanced area.

thanks and regards,
angel
1/ The path should be F:\
2/ As I mentioned, you need to convert DayNo to a string. You can't feed a numeric value into AsciiOutput. You can use the Str() function for that, or the NumberToString function.
3/ I count three opening brackets, but only one closing bracket. These have to match.
4/ Is type the name of the store? It looks like an attribute name rather than a store name.

Assuming that the Type variable is correct, the syntax you'd need is:

Code: Select all

asciioutput( 'F:\outputext.txt', NumberToString( dayno( attrs( 'storename1', type, 'startdate') ) ) );
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by angel1234 »

hi ,
when i tried this

asciioutput('D:outputext.txt',numbertostring(dayno( AttrS('storename1',storename,'StartDate'))));


i got a error log like
"lfl","store1","2005-11-12","","2005.",Data Source line (1) Error: MetaData procedure line (9): Invalid real number

please tell me what to do over this???

thanks and regards
'angel
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by angel1234 »

hi,
here storename refers to ti variable which has sample values like 'store1','store2','store3'...etc
thanks and regards
angel
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by angel1234 »

storename is not an attribute 'startdate' and 'enddate' are my attributes and storename refers the names of stores which comes under the hierrachy supermarket
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: turbo integrator rule

Post by Alan Kirk »

angel1234 wrote:hi ,
when i tried this

asciioutput('D:outputext.txt',numbertostring(dayno( AttrS('storename1',storename,'StartDate'))));


i got a error log like
"lfl","store1","2005-11-12","","2005.",Data Source line (1) Error: MetaData procedure line (9): Invalid real number

please tell me what to do over this???
You'll get that error if the value that your feeding into the DayNo function is not a valid date. For example, if the StartDate attribute of the StoreName element is not populated (it's an empty string), you'll get that as an error.

I suggest adding an output of the attribute value above that line. For example:

Code: Select all

#Tells you what store is being reported
asciioutput('D:\outputext.txt',storename);

# Tells you what the attribute value is, and I'll bet that this store doesn't have one
asciioutput('D:\outputext.txt', AttrS('storename1',storename,'StartDate') );

# This will kick the error if the attribute is invalid. If it's not,
# it'll tell you the date value:
asciioutput('D:\outputext.txt',numbertostring(dayno( AttrS('storename1',storename,'StartDate'))));
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by angel1234 »

hi,
Thank you so much ....

my code is working :)

actually i was running teh condition like this dayno(today)-( dayno( 'startdate' )) .so in the ascii text its written like 'startdate' instead of my actual date. After i removed my single quotes on startdate its working well :)


Thanks and regards,
Angel
monishapm
Posts: 13
Joined: Mon May 17, 2010 10:10 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by monishapm »

Thanks to All . Its working now :)
Post Reply