Problem with calculation
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Problem with calculation
Hy! I need help with rule calculation in TM1:
I need to get value in cell HRK when I put number in EUR (Cube is named Radni sati)
EUR must be multiply with value in second cube named Tečaj. I got screenshots
I need to get value in cell HRK when I put number in EUR (Cube is named Radni sati)
EUR must be multiply with value in second cube named Tečaj. I got screenshots
- Attachments
-
- Tečaj 2.jpg (190.84 KiB) Viewed 9936 times
-
- Radni sati 1.jpg (140.35 KiB) Viewed 9936 times
- qml
- MVP
- Posts: 1097
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Problem with calculation
Welcome to the forum. Please start by familiarising yourself with this post in order to know how to ask good questions and get good answers.
What have you tried already? No one is going to write your rules for you unless you show you have done some work yourself, especially that everything you need to know to solve this problem is in the basic examples in the TM1 Developer Guide. The screenshots you provided, as big as they are, don't really provide the crucial information about the cube structures (dimension names and order) that are needed to solve this problem.
What have you tried already? No one is going to write your rules for you unless you show you have done some work yourself, especially that everything you need to know to solve this problem is in the basic examples in the TM1 Developer Guide. The screenshots you provided, as big as they are, don't really provide the crucial information about the cube structures (dimension names and order) that are needed to solve this problem.
Kamil Arendt
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
I have two cubes. Cube 1 with this order of dimensions: Projekt,Zaposlenik,Period,Scenarij,Valuta,Fakturiranje
and Cube 2 with this order of dimensions: Period,Scenarij,Konverzija,Valuta
Measure dimension in Cube 1 is: Fakturiranje with elements Fakturabilni sati and Nefakturabilni sati
Measure dimension in Cube 2 is: Konverzija with element Tečaj
Dimension Valuta has two elements with EUR and HRK
I wrote rule to calculate HRK value when you type number (value) in EUR in Cube 1.
When you write EUR value it need to be multiplay with value in cube 2 EUR
Cube 2 is currency converting cube for example if EUR in this cube is 7.5 it must
be muliply with EUR vale in cube 1 let's say 5 and get value HRK in cube 1.
In this example value should be HRK=7.5X5=37,5
My rule doesn'work. Rule is accepted but nothing happend
#Region System
FEEDSTRINGS;
SKIPCHECK;
#EndRegion
['HRK']=N:IF(['EUR']>0,['EUR']*DB('Tečaj',!Period,!Scenarij,'EUR'),0);
FEEDERS;
['EUR']=>['HRK'];
and Cube 2 with this order of dimensions: Period,Scenarij,Konverzija,Valuta
Measure dimension in Cube 1 is: Fakturiranje with elements Fakturabilni sati and Nefakturabilni sati
Measure dimension in Cube 2 is: Konverzija with element Tečaj
Dimension Valuta has two elements with EUR and HRK
I wrote rule to calculate HRK value when you type number (value) in EUR in Cube 1.
When you write EUR value it need to be multiplay with value in cube 2 EUR
Cube 2 is currency converting cube for example if EUR in this cube is 7.5 it must
be muliply with EUR vale in cube 1 let's say 5 and get value HRK in cube 1.
In this example value should be HRK=7.5X5=37,5
My rule doesn'work. Rule is accepted but nothing happend
#Region System
FEEDSTRINGS;
SKIPCHECK;
#EndRegion
['HRK']=N:IF(['EUR']>0,['EUR']*DB('Tečaj',!Period,!Scenarij,'EUR'),0);
FEEDERS;
['EUR']=>['HRK'];
- qml
- MVP
- Posts: 1097
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Problem with calculation
No Cube 1 / Cube 2 nonsense, please. Let's use the real cube names as in your original post. You did not say which cube you put the rule in - it needs to be 'Radni sati'. I would change the code a bit. You don't need FEEDSTRINGS or that '>0' check. You also omitted one of the dimensions in your 'Tečaj' cube reference (it has 4 dims, not 3). Something like that should work:
Now, it seems from your screenshots that you currently have no rule applied in 'Radni sati' as otherwise the 'HKR' cells should be greyed out. So make sure you save the rule correctly.
Code: Select all
SKIPCHECK;
['HRK']= N: ['EUR'] * DB('Tečaj',!Period,!Scenarij,'Tečaj','EUR');
FEEDERS;
['EUR']=>['HRK'];
Kamil Arendt
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
I wrote your roule but unfortunatelly it doesn't work. Maybe piture can help.
Cube 1 is Radni sati
Cube 2 is Tečaj
Cube 1 is Radni sati
Cube 2 is Tečaj
- Attachments
-
- SLika 1.jpg (119.25 KiB) Viewed 9912 times
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Problem with calculation
In your rule:
The !Valuta reference will bring back the currency set on the left hand side of the rule (in this case "HRK"); the cube intersetion you have shown has a rate in "EUR"... presumably you want to point to "EUR" rather than "HRK".
Code: Select all
['HRK']=N: ['EUR'] * DB('Tecaj',!Period,!Scenrij,'Tecaj',!Valuta);
Declan Rodger
- qml
- MVP
- Posts: 1097
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Problem with calculation
No, sorry, it's blatantly obvious from your screenshot that you did not use the code I provided. You changed it and that's why it's not working.
Kamil Arendt
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Problem with calculation
It is worth noting that if you had right clicked on the target cell and selected "Trace Calculation" you would be able to see exactly where it is pulling values from.
Declan Rodger
-
- Community Contributor
- Posts: 248
- Joined: Tue Nov 01, 2011 10:31 am
- OLAP Product: TM1
- Version: All
- Excel Version: All
- Location: Manchester
- Contact:
Re: Problem with calculation
It is also worth noting that there is an Exchange Rates example in Chapter 3 of the Rules Guide
http://www-01.ibm.com/support/docview.w ... wg27041359
Not only this but the default Samples installed with Cognos TM1 also include the necessary objects from the Rules Guide to test creating the rules. In a standard install these files should be available here:
C:\Program Files\ibm\cognos\tm1_64\samples\tm1\Rules_Guide_Data
http://www-01.ibm.com/support/docview.w ... wg27041359
Not only this but the default Samples installed with Cognos TM1 also include the necessary objects from the Rules Guide to test creating the rules. In a standard install these files should be available here:
C:\Program Files\ibm\cognos\tm1_64\samples\tm1\Rules_Guide_Data
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
Hi! I really don't know why my rule formula doesn't work. I've read rules guide, but it doesn't help. Please anyone can help me to get right calculation.
If you look at the picture I need to get for example this value with rule
Cube named Uloga na projektu: HRK Cijena po satu=EUR Cijena po satu* EUR from Cube named Tečaj
So if we see Dražen horvat the value is 10*7,5=75 HRK I get nothing in HRK field?
If you look at the picture I need to get for example this value with rule
Cube named Uloga na projektu: HRK Cijena po satu=EUR Cijena po satu* EUR from Cube named Tečaj
So if we see Dražen horvat the value is 10*7,5=75 HRK I get nothing in HRK field?
- Attachments
-
- Slikovito.jpg (158.85 KiB) Viewed 9843 times
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Problem with calculation
Have you tried tracing calculations on the target cell to see what it is doing as I suggested earlier? - This almost always gives away everything you need to know.
It could be the order of your dimensions; unless I have missed it somewhere in the thread I didn't notice the order of dims - this will be important for your DB reference that they are in the right order.
It could be the order of your dimensions; unless I have missed it somewhere in the thread I didn't notice the order of dims - this will be important for your DB reference that they are in the right order.
Declan Rodger
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
Here is the order of dimensions in both cubes:
- Attachments
-
- Uloga na projektu order.jpg (74.37 KiB) Viewed 9841 times
-
- Tečaj order dimension.jpg (64.34 KiB) Viewed 9841 times
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
When I click trace calculation in Cube Uloga na projektu cube in intersection Dražen Horvat and HRK cijena po satu nothing happens
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Problem with calculation
Your trace calc issue seems surprising. It does sometimes open a pop up window in a small box that you need to expand to a useable size.
Just noticed that your most recent screenshot only has 3 dimensions referenced in the "Tecaj" cube even though the cube has 4 dimensions and your earlier posts included 4 dimensions. Why have you gone back to removing one??
Have a look at re-ordering the statement (the one with all 4 dimensions referenced) to mimic the original order of dimensions instead of the re-ordered one.
Just noticed that your most recent screenshot only has 3 dimensions referenced in the "Tecaj" cube even though the cube has 4 dimensions and your earlier posts included 4 dimensions. Why have you gone back to removing one??
Have a look at re-ordering the statement (the one with all 4 dimensions referenced) to mimic the original order of dimensions instead of the re-ordered one.
Declan Rodger
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
I've adjusted new order with original one if you had meant that? I' also found pop up window to trace calculation. But unfortunally the problem is same:
- Attachments
-
- sve.jpg (115.96 KiB) Viewed 9833 times
-
- novi poredak 2.jpg (62.51 KiB) Viewed 9833 times
-
- novi poredak 1.jpg (73.6 KiB) Viewed 9833 times
-
- Posts: 12
- Joined: Sat Mar 05, 2016 8:59 pm
- OLAP Product: IBM Tm1
- Version: 10.1.0
- Excel Version: Office plus 2013
Re: Problem with calculation
I also included all dimensions from referencing cube Tečaj in calculation.
-
- Posts: 78
- Joined: Wed Jul 31, 2013 4:32 am
- OLAP Product: Cognos TM1, EP, Analyst
- Version: 10.2.2
- Excel Version: 2013
- Location: Sydney AU
Re: Problem with calculation
Please check your rule trace screen, 3rd item, it is referencing to HRK, which is returning 0. While your rule is structured correctly, are the element references correct?
MK
- qml
- MVP
- Posts: 1097
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: Problem with calculation
It is hard not to shout at this point, but I will try my best. I have given you the exact code that you just need to copy-paste and it will work. In each screenshot you are showing a slightly different version of the rule (and of the cubes!), none of which can work.
When the solution works, try and spend the time to understand why it does work and why your attempts didn't. Reading the guide that was already suggested to you will help greatly.
To summarise, you already received all the help you needed yesterday, now you just need to pay attention and apply it.
When the solution works, try and spend the time to understand why it does work and why your attempts didn't. Reading the guide that was already suggested to you will help greatly.
To summarise, you already received all the help you needed yesterday, now you just need to pay attention and apply it.
Kamil Arendt
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Problem with calculation
As has now been mentioned quite a few times you need to reference 'EUR' in the DB statement; if you don't specify it will pull the same element on the left hand side.
Declan Rodger
-
- Posts: 78
- Joined: Wed Jul 31, 2013 4:32 am
- OLAP Product: Cognos TM1, EP, Analyst
- Version: 10.2.2
- Excel Version: 2013
- Location: Sydney AU
Re: Problem with calculation
Knew I heard someone screaming across town.qml wrote:It is hard not to shout at this point, but I will try my best. I have given you the exact code that you just need to copy-paste and it will work. In each screenshot you are showing a slightly different version of the rule (and of the cubes!), none of which can work.
When the solution works, try and spend the time to understand why it does work and why your attempts didn't. Reading the guide that was already suggested to you will help greatly.
To summarise, you already received all the help you needed yesterday, now you just need to pay attention and apply it.
MK