Data Bands in TM1
Posted: Tue Jun 30, 2009 5:04 pm
I'm hoping there's a cleaner way of implementing this general capability --
take a product's average selling price and based on the price band of that product (i.e. PB #1 = $0 to $99.99, PB#2 = $100 to $199.99 etc), calculate a result.
In Excel, I could take an ASP value and a price band, high-low table and with one sumproduct statement, calculate which price band the product fell into.
In TM1, I've so far written this mess (and this is only for the first Price Band -- there are 5 total):
Is there a better way than replicating this for the 4 remaining price bands (and then re-replicating for a different metric)?
There's no CASE or Variable support logic in the rules world is there?
Thanks.
-- John
take a product's average selling price and based on the price band of that product (i.e. PB #1 = $0 to $99.99, PB#2 = $100 to $199.99 etc), calculate a result.
In Excel, I could take an ASP value and a price band, high-low table and with one sumproduct statement, calculate which price band the product fell into.
In TM1, I've so far written this mess (and this is only for the first Price Band -- there are 5 total):
Code: Select all
['FY10', 'WhatIf', 'Store', 'POS Sales' ] = N: if (attrs('Product', !Product, 'PSP Class') @= '', STET,
# PB1 CHECK
IF (DB('Price Band Definitions', 'PB1', 'Low', !Product) <=
# POS Sales /
DB('M',!Year, !Scenario, !Channel, attrs('Product', !Product, 'PSP Class'), 'POS Sales',!Period) /
# Units
DB('M',!Year, !Scenario, !Channel, attrs('Product', !Product, 'PSP Class'), 'Units',!Period) &
# And
DB('Price Band Definitions', 'PB1', 'High', !Product) >=
DB('M',!Year, !Scenario, !Channel, attrs('Product', !Product, 'PSP Class'), 'POS Sales',!Period) /
DB('M',!Year, !Scenario, !Channel, attrs('Product', !Product, 'PSP Class'), 'Units',!Period),
# Calculation
# Parent Units * Attach Rate * Rev / Unit
DB('M',!Year, !Scenario, !Channel, attrs('Product', !Product, 'PSP Class'), 'Units',!Period) *
DB('Attach Drivers', !Year, !Scenario, !Channel, !Product, 'PB1', 'Attach Rate', !Period) *
DB('Attach Drivers', !Year, !Scenario, !Channel, !Product, 'PB1', 'Rev / Attach Unit', !Period),
STET));
There's no CASE or Variable support logic in the rules world is there?
Thanks.
-- John