TM1 calculation option
Posted: Mon Jul 31, 2017 11:06 am
Dear all,
I am almost embarrassed to post this but while I am here I thought I may as well:
I need to add a very simple tax calculation to an existing rule but have a number of options and want some advice on what the best option is.
The tax calculation is adding 13.8% to the current calculation, so for example 100*(1+0.138) = £113.80
On the source input process I have added some code to populate a Y/blank attribute flag for ‘taxable’.
So my first thought was to create the Y/blank taxable attribute flag and in the rule put in an if statement saying if taxable = Y then multiply the value by 13.8% else just use the current calculation.
But then I thought why not instead just create a numeric taxable attribute and populate the attribute WITH 0.138 if it is taxable and get rid of the if statement in the rule altogether. So I just add to the existing rule * (1 + ATTRN(Dimension, Element, 'Taxable'))
I am thinking the second option is best, can anyone envisage any issues?
Please note the calculation is fed from a different element, so I don’t see that being an issue.
I am almost embarrassed to post this but while I am here I thought I may as well:
I need to add a very simple tax calculation to an existing rule but have a number of options and want some advice on what the best option is.
The tax calculation is adding 13.8% to the current calculation, so for example 100*(1+0.138) = £113.80
On the source input process I have added some code to populate a Y/blank attribute flag for ‘taxable’.
So my first thought was to create the Y/blank taxable attribute flag and in the rule put in an if statement saying if taxable = Y then multiply the value by 13.8% else just use the current calculation.
But then I thought why not instead just create a numeric taxable attribute and populate the attribute WITH 0.138 if it is taxable and get rid of the if statement in the rule altogether. So I just add to the existing rule * (1 + ATTRN(Dimension, Element, 'Taxable'))
I am thinking the second option is best, can anyone envisage any issues?
Please note the calculation is fed from a different element, so I don’t see that being an issue.