If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Simple String rule calculation question

Started by deadsea, 01 Sep 2015 08:37:33 AM

Previous topic - Next topic

deadsea

Hello All:

A TM1 question as I have not worked with string calculations thus far (only N and C type values which worked just fine)....

I have a string type measure named COUNTRY, and I am trying to create a calculated measure via rules editor for another measure named COUNTRY CODE.

Pseudo code that I want to achieve:

Set COUNTRY CODE to SUBSTR('COUNTRY', 1, 3)

Being new to TM1, instead of extracting the string, I just tried a simple rule for now:

#Set 'COUNTRY CODE' from 'COUNTRY'
['COUNTRY CODE'] = S: DB('COUNTRY')

NOTE: In above formulation source and target cube are same.

However, when I do this COUNTRY DAYS goes from white to gray and value entered in COUNTRY measure does not get copied over to COUNTRY CODE. I was expecting the value selected in the COUNTRY entry field by my pick list to be also populated in COUNTRY CODE.

Is there something I am doing wrong? I have no errors being thrown from rules editor.

Any help is appreciated.

Thanks.

deadsea

I think I got this resolved.

Unintuitive or not, what worked is putting the name of the cube within the DB call. So now when I do:

['COUNTRY CODE'] = S: DB('SampleCube', !measure_with_txt, 'COUNTRY');

I was also able to perform my substring as:

['COUNTRY CODE'] = S:SUBST(DB('SampleCube', !measure_with_txt, 'COUNTRY'));

Hope it helps others.