Page 1 of 1

Copying Strring type of elements using rules.

Posted: Mon Sep 26, 2011 7:47 pm
by ravi.ahuja21
Hi All,

I have a requirement from the client where I have to copy the string type of measure across months.

For Eg:

The client is budgeting on a project which is a memo field or perhaps a string type of measure and he wants to enter the project name only once for the entire year at the consolidated level which is 'total months' and wants that to be copied automatically into the month level which is 'jan,feb,mar' so on.

I am not sure how to do this, or even if it is possible to do this using cube rules.

I have attached a print screen for your reference.

Re: Copying Strring type of elements using rules.

Posted: Mon Sep 26, 2011 8:31 pm
by qml
ravi.ahuja21 wrote:I am not sure how to do this, or even if it is possible to do this using cube rules.
In this case I think you should really start with the basics instead of trying to sell yourself as a developer to your customer. Just start reading the TM1 Rules guide and you can quite quickly stumble upon this paragraph:
TM1 Rules 9.5 wrote:Using rules, you can:
- Multiply prices by units to yield sales amounts.
- Override consolidations when needed. For example, you can prevent a quarterly average price from displaying a tally of individual monthly prices.
- Use data in one cube to perform calculations in another cube, or share data between cubes. For example, you can pull sales data into a cube that contains profit and loss data.
- Assign the same values to multiple cells.
In another place in the same guide you can find this enlightening paragraph:
Tm1 Rules 9.5 wrote:In TM1, there is a distinction between leaf or numeric cells, whose coordinates are all leaf/numeric (N:) elements in their respective dimensions; consolidated cells, which have at least one consolidated (C:) element among their coordinates; and string cells, use a string (S:) element as the last coordinate. The leaf/consolidation/string qualifier indicates whether, for a defined area, a statement applies only to leaf cells, only to consolidated cells, only to string cells, or (in the absence of a qualifier) to all cells. (...) If the qualifier is S:, the statement applies to string cells only.
And finally, the very same guide instructs the faithful reader:
Tm1 Rules 9.5 wrote:If a calculation statement references a string element, you must use a DB function to retrieve the string, even if the string resides in the same cube for which you are writing a rule.
Now, since I have spent the time to compile these bits for you to spare you the need to actually read the documentation of the product you're working with, all you need to do now is apply the above knowledge to write a very, very basic rule. Surely a developer should at least give it a try before asking fellow forum members for help?

Re: Copying Strring type of elements using rules.

Posted: Mon Sep 26, 2011 9:31 pm
by ravi.ahuja21
Sorry for that.

I have just got into TM1 and directly on to the project and I am the only technical and functional person in the team :shock: and I have deadlines to meet, so it was out of desperation.

Thanks for your valuable time and guidance. I will keep that in mind.

Re: Copying Strring type of elements using rules.

Posted: Mon Sep 26, 2011 10:13 pm
by qml
Don't be sorry, I realise where you're coming from and I meant no disrespect to you either. However, desperation is never a good motivation, as desperation can lead you to either sink or swim, but it will never teach you how to successfully swim again the next time you you're forced to. I don't think I'd ever agree to be in a position like yours, but hey, sometimes we don't have the choice, right?
The only advice I can give is:
Start with the basic documentation and try to learn by doing, applying what you've read. You can always ask for help on the forum, but be sure to make your questions as specific as possible and show that you have made some effort yourself. In the specific case this thread is about you should be able to attempt to write this rule and see what results you get. In case of any issues you can always post your code here and you're pretty much certain to find a helping hand. However, if your post go along the lines of "how do I write rules?" then the quantity and quality of help you can get here will likely be very limited indeed.

Re: Copying Strring type of elements using rules.

Posted: Mon Sep 26, 2011 10:43 pm
by lotsaram
ravi.ahuja21 wrote:I have just got into TM1 and directly on to the project and I am the only technical and functional person in the team :shock: and I have deadlines to meet, so it was out of desperation.
Don't forget that not only developers/consultants read this forum but many customers/users do too. Some of the questions you are posting are not a good look for you and certainly reflect very poorly on whatever company you work for. Don't get me wrong as I don't mean to discourage you, I think you probably have the right attitude and you are certainly more polite and thankful than some others who will remain nameless and that goes a long way towards others cutting you some slack. However you do need to demonstrate that some effort has gone into solving a problem before calling out for help. There are plenty of people prepared to help someone who is prepared to learn and put in the effort but not that many who are prepared to spend their own time to provide solutions on a platter for someone who is being paid as and represented to a customer as an "expert consultant".

Re: Copying Strring type of elements using rules.

Posted: Mon Sep 26, 2011 11:27 pm
by ravi.ahuja21
Thanks guys, you have been very helpful.I know that this question was a spoon feeder.My sincere apologies for that.

I will make sure that doesn't happens next time, I have too many things to do too little time to do that :roll:.

It is basically a challenge that sometimes we have to accept and I have accepted it, so lets see how things go.