Page 1 of 1
Assigning format to a view in a TI process
Posted: Mon Jun 21, 2010 3:54 pm
by Catherine
Hello,
I create some default views for users through TI processes.
Do you know a TI function which would allow me to assign a format to a view, or to some elements?
What I tried so far is to assign a format to some elements with attrputs function, like for instance:
attrputs('b:#,##0CO|0|','UNIT',V2,'FORMAT');
This instruction works individually.
But the thing is that I have many instances, and that processes are deployed to all instances through a zip file. The format (for instance 'b:#,##0CO|0|') is no more a valid format after being zipped and unzipped...
Any idea to help me?
Thanks in advance
Re: Assigning format to a view in a TI process
Posted: Mon Jun 21, 2010 8:47 pm
by Alan Kirk
Catherine wrote:Hello,
I create some default views for users through TI processes.
Do you know a TI function which would allow me to assign a format to a view, or to some elements?
What I tried so far is to assign a format to some elements with attrputs function, like for instance:
attrputs('b:#,##0CO|0|','UNIT',V2,'FORMAT');
This instruction works individually.
But the thing is that I have many instances, and that processes are deployed to all instances through a zip file. The format (for instance 'b:#,##0CO|0|') is no more a valid format after being zipped and unzipped...
The attributes (including format) are stored in the dimension's attributes cube; this will be named
}ElementAttributes_DimensionName, where "DimensionName" is the name of the dimension that the attributes are for. Those cubes have two dimensions; one is the dimension for which it is storing the attributes, and the other is a dimension which has the same name as the cube (that is,
}ElementAttributes_DimensionName). You need to ensure that you send that cube and dimension with your zip file when you're deploying it.
Re: Assigning format to a view in a TI process
Posted: Tue Jun 22, 2010 7:35 am
by jstrygner
I am not exactly sure what your real issue is (and I would rather blame here me, not your post

), but I did a quick test, that maybe will help you in your case.
I created two small views that differ only with a fact that first of them has no formatting, second has a thousands separator and two decimal places.
I saved both files and the only difference I see is in two places in code in the .vue files. I will not put here screen-shots, just encourage to do the same easy test.
First place seems to be very intuitive:
375,b:0.#########G|0| (no formatting)
vs
375,b:#,##0.00CO|2| (with formatting)
Second place is in my case second line from the bottom in both .vue files:
11,20100622070827 (no formatting)
vs
11,20100622070845 (with formatting)
What I did later I shut down the TM1 server, copied the upper code from formatted .vue file to non formatted, left the lower code in the non formatted as it was and started the TM1 server. The formerly unformatted view had the same formatting set as the formatted one (like the second part of a code did not matter).
Note:
Changing the .vue file while the server was not down and then shutting down the server caused overwriting my change for the unformatted view, so it looks like putting server down before changes in files is necessary.
HTH
Re: Assigning format to a view in a TI process
Posted: Thu Jun 24, 2010 1:34 pm
by Catherine
Thanks for your answers,
Alan Kirk,
I already have the dimension's attributes cube because my dimension elements have two aliases.
jstrygner,
I can not copy the .vue file because the views are recreated through a TI process during the night process.
In order to better explain the context, here are some additional explanations. I have a development instance. When I make some changes (evolutions/corrections), I take the different objects which have been changed (most of the time processes or rules). I put them in a zip file (on the development server). These files are automatically deployed to the 21 production instances (on the production servers).
I tried 2 ways to input my format in my process:
1/ attrputs('b:#,##0CO|0|','UNIT',V2,'FORMAT');
2/ CellPutS('b:#,##0CO|0|','}ElementAttributes_UNIT',V2,'FORMAT');
The problem is that TM1 does does not recognize 'Format' as an existing attribute (in 1/), nor as an element of }ElementAttributes_UNIT dimension (in 2/). As a matter of fact, if you have a look at the }ElementAttributes_UNIT dimension, it does not contain a 'Format' element...
Any idea?
Thanks in advance
Catherine
Re: Assigning format to a view in a TI process
Posted: Thu Jun 24, 2010 3:06 pm
by kpk
"The problem is that TM1 does does not recognize 'Format' as an existing attribute (in 1/), nor as an element of }ElementAttributes_UNIT dimension (in 2/). As a matter of fact, if you have a look at the }ElementAttributes_UNIT dimension, it does not contain a 'Format' element...
Any idea?"
As far as I remember the FORMAT element inserted into the ElementAttributes_UNIT dimension when you change at least one element format for the first time.
Afterwards you will see it in the attribute dimension.
Regards,
Peter
Re: Assigning format to a view in a TI process
Posted: Fri Jun 25, 2010 2:56 am
by Andy Key
Further to what Peter said, you can force the Format attribute to be created on your production servers without making any manual changes by running
Code: Select all
AttrInsert( 'UNIT', '', 'Format', 's');
in your process before your AttrPutS lines.
Re: Assigning format to a view in a TI process
Posted: Fri Jul 02, 2010 3:56 pm
by Catherine
Thanks Andy,
It works perfectly well with that instruction
So far it works on my development server. I hope it will work fine as well on my production servers, because I tried a few months ago, and I thought the problem was with the format itself. It seemed to me that zipping and unzipping the format was my problem, but I have good reason to think that I was wrong

. I'll try next week.