Page 1 of 1
Assigning string value in a rule
Posted: Fri Jun 09, 2017 6:46 pm
by Analytics123
Hi I have certain calculations on measures and a I have a measure called total points that is calculated in a rule .Now based on the value of this calculated Measure called total points I need to assign letter grades .
Say if total points is >75 then "B" etc..
Is it possible to set values like "A" , "B" via rule . I am getting error when i do this
[Grade]=if([Total Points] >75,'A','B'); but this syntax gives error .
Since strings cant be consolidated is this not possible in tm1 .
Thanks,
Re: Assigning string value in a rule
Posted: Fri Jun 09, 2017 7:34 pm
by declanr
Try ['Grade']=S:
Re: Assigning string value in a rule
Posted: Fri Jun 09, 2017 9:31 pm
by Analytics123
Yeah that works now !! But when a zero supression is done all values for that string measure disappears to No Values .
I tried giving FEEDSTRINGS; at the top of the rule , but that doesnt fix the issue .
Any help to overcome this is appreciated .
Thanks,
Re: Assigning string value in a rule
Posted: Fri Jun 09, 2017 10:10 pm
by declanr
Did you put a feeder in as well or just feedstrings?
Re: Assigning string value in a rule
Posted: Sat Jun 10, 2017 2:17 am
by Analytics123
Yes feederstrings;
Skipcheck;
and feeders:
Re: Assigning string value in a rule
Posted: Sat Jun 10, 2017 5:56 am
by BariAbdul
Could you please post you whole rules including feeders statement. Thanks
Re: Assigning string value in a rule
Posted: Mon Jun 12, 2017 3:49 am
by EvgenyT
Analytics123 wrote:Hi I have certain calculations on measures and a I have a measure called total points that is calculated in a rule .Now based on the value of this calculated Measure called total points I need to assign letter grades .
Say if total points is >75 then "B" etc..
Is it possible to set values like "A" , "B" via rule . I am getting error when i do this
[Grade]=if([Total Points] >75,'A','B'); but this syntax gives error .
Since strings cant be consolidated is this not possible in tm1 .
Thanks,
Is this a c level string rule? If so, It willl show blank on zero supression, since there is no fed value in the consol.
You can make Grade a consol of Total Points, that way you dont need to feed.
Re: Assigning string value in a rule
Posted: Mon Jun 12, 2017 1:20 pm
by Analytics123
FeedStrings;
SKIPCHECK;
['Letter Grade'] = S:if (['Total Points']<=DB('AR Parameter Scoring', 'Grade F', 'Upper Limit'),'F',if((['Total Points']>=DB('AR Parameter Scoring', 'Grade D', 'Lower Limit') & ['Total Points']<=DB('AR Parameter Scoring', 'Grade
D', 'Upper Limit')),'D',
if((['Total Points']>=DB('AR Parameter Scoring', 'Grade C', 'Lower Limit') & ['Total Points']<=DB('AR Parameter Scoring', 'Grade C', 'Upper Limit')),'C',if((['Total Points']>=DB('AR Parameter Scoring', 'Grade B', 'Lower Limit') & ['Total Points']<=DB('AR
ParameterScoring', 'Grade B', 'Upper Limit')),'B',if((['Total Points']>=DB('AR Parameter Scoring', 'Grade A', 'Lower Limit') & ['Total Points']<=DB('AR Parameter Scoring', 'Grade A', 'Upper Limit')),'A','INACTIVE')))));
FEEDERS;
['Total Points'] => ['Letter Grade'];
Hi , i have listed above my code used in rules , however total points measure is a calculation of few other fields in the model .
The issue I am having is on Zero suppression eventhought there are letter grades applicable , tm1 shows no values , I am not sure whats happening here .
Any help to trace back the issue is appreciated .Is the issue because when the totalpoints has a zero value , then the feeding doesnt happen for any cells .
Thanks,
Re: Assigning string value in a rule
Posted: Mon Jun 12, 2017 9:29 pm
by EvgenyT
Analytics123 wrote:
Any help to trace back the issue is appreciated .Is the issue because when the totalpoints has a zero value , then the feeding doesnt happen for any cells .
Thanks,
Feeder only fires when a numeric value goes from 0 to a value. Hence nothing when TotalPoints is zero. Also, are points calculations themselves? If so, there may be a feeding issue downstream.
P.s. I would invest a little time in making those rules bit more readable.