TI Process Questions

Post Reply
nhavis
Posts: 62
Joined: Mon Jan 05, 2009 12:47 am

TI Process Questions

Post by nhavis »

A few questions:
--------------------

Within a TI process - how can you find out the names of all cubes?
- Possible solution to look in the Data folder for all files named *.cub ?

Within a TI process - how can you find out the names of all dimensions?
Within a TI process - how can you find out which dimensions a cube is using?
Within a TI process - how can you find out which cubes use a particular dimension?
glaurens
Posts: 41
Joined: Thu Jan 08, 2009 3:42 pm

Re: TI Process Questions

Post by glaurens »

nhavis wrote:A few questions:
--------------------

Within a TI process - how can you find out the names of all cubes?
- Possible solution to look in the Data folder for all files named *.cub ?

Within a TI process - how can you find out the names of all dimensions?
Within a TI process - how can you find out which dimensions a cube is using?
Within a TI process - how can you find out which cubes use a particular dimension?

Cubes - loop through }Cubes dimension
Dimns - loop through }Dimensions dimension
Cube/Dimn usage - TABDIM function

G
nhavis
Posts: 62
Joined: Mon Jan 05, 2009 12:47 am

Re: TI Process Questions

Post by nhavis »

Thanks - how can I get the number of dimensions in a cube?
User avatar
Alan Kirk
Site Admin
Posts: 6606
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: TI Process Questions

Post by Alan Kirk »

nhavis wrote:Thanks - how can I get the number of dimensions in a cube?
Just loop through the dims until you hit a blank. For example:

Code: Select all

SC_CUBE = 'YourCubeName';

l_Counter = 1;

While ( l_Counter <=256 );

    s_DimName = TabDim ( SC_CUBE, l_Counter); 

    If ( s_DimName @= '');

        l_NumberOfDims = l_Counter - 1;

        l_Counter = 257;

    Else;

        l_Counter = l_Counter + 1;

    EndIf;

End; 

Yes, there probably should be a function to return this, buuuut....
"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.
ScottW
Regular Participant
Posts: 152
Joined: Fri May 23, 2008 12:08 am
OLAP Product: TM1 CX
Version: 9.5 9.4.1 9.1.4 9.0 8.4
Excel Version: 2003 2007
Location: Melbourne, Australia
Contact:

Re: TI Process Questions

Post by ScottW »

Documenting_Dimension_Usage_by_Cube.zip
(86.34 KiB) Downloaded 392 times
Cheers,
Scott W
Cubewise
www.cubewise.com
nhavis
Posts: 62
Joined: Mon Jan 05, 2009 12:47 am

Re: TI Process Questions

Post by nhavis »

Thanks for the quick and concise replies -

How can I add in a a newline character to a string?

Eg.

string = 'Hello';
string = string|'\n';
string = string|'more';

ASCIIOUTPUT('output.txt', string);

How can I add in other special characters?
User avatar
Alan Kirk
Site Admin
Posts: 6606
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: TI Process Questions

Post by Alan Kirk »

nhavis wrote:Thanks for the quick and concise replies -

How can I add in a a newline character to a string?

Eg.

string = 'Hello';
string = string|'\n';
string = string|'more';

ASCIIOUTPUT('output.txt', string);

How can I add in other special characters?
Use the CHAR rules function. New line is Char(10) (though you probably really want carriage return which is Char(13)). You can Google a list of ASCII codes for other characters; there are a lot of charts out there, though I don't have any bookmarked at the moment.
"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.
nhavis
Posts: 62
Joined: Mon Jan 05, 2009 12:47 am

Re: TI Process Questions

Post by nhavis »

I see, thanks again -

Is it possible to write an output file without the quotes that ASCIIOUTPUT includes?
Is there any kind of console or substitute?
ScottW
Regular Participant
Posts: 152
Joined: Fri May 23, 2008 12:08 am
OLAP Product: TM1 CX
Version: 9.5 9.4.1 9.1.4 9.0 8.4
Excel Version: 2003 2007
Location: Melbourne, Australia
Contact:

Re: TI Process Questions

Post by ScottW »

ASCIIOutput and TextOutput both write comma delimited files and only output string values encased in quotes, if you want to change this see Gregor's post below ;)
Last edited by ScottW on Fri Jan 16, 2009 3:17 am, edited 1 time in total.
Cheers,
Scott W
Cubewise
www.cubewise.com
nhavis
Posts: 62
Joined: Mon Jan 05, 2009 12:47 am

Re: TI Process Questions

Post by nhavis »

Thanks -

In regards to inserting new line characters: I tried the following and in notepad it seems not to work:

string = '123';

string = string | Char(10);
string = string | Char(13);

string = string | '456';

ASCIIOUTPUT('output.txt', string);
ExecuteCommand('notepad output.txt', 0);

output.txt contained (when viewed in notepad):
"123456"

however the newline characters were present when viewed in vim/wordpad etc.
User avatar
Alan Kirk
Site Admin
Posts: 6606
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: TI Process Questions

Post by Alan Kirk »

nhavis wrote:Thanks -

In regards to inserting new line characters: I tried the following and in notepad it seems not to work:

string = '123';

string = string | Char(10);
string = string | Char(13);

string = string | '456';

ASCIIOUTPUT('output.txt', string);
ExecuteCommand('notepad output.txt', 0);

output.txt contained (when viewed in notepad):
"123456"

however the newline characters were present when viewed in vim/wordpad etc.
They're there in Notepad too, but the way you've output them they'll just appear as rectangular blocks representing control characters.

The usual sequence when you combine a carriage return and line feed (alias New Line) is CRLF rather than LFCR. Reverse the order so that it's

Code: Select all

string = string | Char(13);
string = string | Char(10);
rather than

Code: Select all

string = string | Char(10);
string = string | Char(13);
I found that that gave the line break that you're after in Notepad.
"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.
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: TI Process Questions

Post by Gregor Koch »

Hi

If you want AsciiOutPut without quotes use function
(that's two single quotes no space)

DataSourceASCIIQuoteCharacter='';


If you want no delimiter use function
(can be changed to anything)

DatasourceASCIIDelimiter='';


If you want your output to be eg

123
789

use the above and then

AsciiOutPut('filename', '123');
AsciiOutPut('filename', '789');

Hope it helps

Cheers

Gregor
Post Reply