How to write sum function

Post Reply
blusky_1010
Posts: 5
Joined: Tue Mar 19, 2013 2:37 am
OLAP Product: IBM Cognos TM1
Version: 10.1.1
Excel Version: 2007

How to write sum function

Post by blusky_1010 »

i have a cube with Dimension follow:
https://plus.google.com/u/0/photos/1114 ... oOkp5vOsgE
i want to calculation ['DONGTHU','02.2013'] = sum ['DONGTHU' (02.2013----> END Of Row)]
please help me!
Thanks so much!
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: How to write sum function

Post by Alan Kirk »

blusky_1010 wrote:i have a cube with Dimension follow:
i want to calculation ['DONGTHU','02.2013'] = sum ['DONGTHU' (02.2013----> END Of Row)]
please help me!
It appears that what you want is to calculate the sum of the "Year To Go"; that is, the sum of all months from the current one to the end of the year. You do that by just creating a consolidation hierarchy. You should know how to do that since you already have one in the screenshot where you've added up all of the month elements to get the year elements.

The consolidation element YTG 12.2013 is defined as the N level element 12.2013
The consolidation element YTG 11.2013 is defined as the consolidation element YTG 12.2013 + the N level element 11.2013
The consolidation element YTG 10.2013 is defined as the consolidation element YTG 11.2013 + the N level element 10.2013
and so on until you reach
The consolidation element YTG 02.2013 which is defined as YTG 03.2013 + 02.2013

In that way you get the value that you want by selecting the combination of the DongThu element, and the YTG 02.2013 element.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
blusky_1010
Posts: 5
Joined: Tue Mar 19, 2013 2:37 am
OLAP Product: IBM Cognos TM1
Version: 10.1.1
Excel Version: 2007

Re: How to write sum function

Post by blusky_1010 »

Alan Kirk wrote:
blusky_1010 wrote:i have a cube with Dimension follow:
i want to calculation ['DONGTHU','02.2013'] = sum ['DONGTHU' (02.2013----> END Of Row)]
please help me!
It appears that what you want is to calculate the sum of the "Year To Go"; that is, the sum of all months from the current one to the end of the year. You do that by just creating a consolidation hierarchy. You should know how to do that since you already have one in the screenshot where you've added up all of the month elements to get the year elements.

The consolidation element YTG 12.2013 is defined as the N level element 12.2013
The consolidation element YTG 11.2013 is defined as the consolidation element YTG 12.2013 + the N level element 11.2013
The consolidation element YTG 10.2013 is defined as the consolidation element YTG 11.2013 + the N level element 10.2013
and so on until you reach
The consolidation element YTG 02.2013 which is defined as YTG 03.2013 + 02.2013

In that way you get the value that you want by selecting the combination of the DongThu element, and the YTG 02.2013 element.
thanks so much, i'll try to do it :)
blusky_1010
Posts: 5
Joined: Tue Mar 19, 2013 2:37 am
OLAP Product: IBM Cognos TM1
Version: 10.1.1
Excel Version: 2007

Re: How to write sum function

Post by blusky_1010 »

Alan Kirk wrote:
blusky_1010 wrote:i have a cube with Dimension follow:
i want to calculation ['DONGTHU','02.2013'] = sum ['DONGTHU' (02.2013----> END Of Row)]
please help me!
It appears that what you want is to calculate the sum of the "Year To Go"; that is, the sum of all months from the current one to the end of the year. You do that by just creating a consolidation hierarchy. You should know how to do that since you already have one in the screenshot where you've added up all of the month elements to get the year elements.

The consolidation element YTG 12.2013 is defined as the N level element 12.2013
The consolidation element YTG 11.2013 is defined as the consolidation element YTG 12.2013 + the N level element 11.2013
The consolidation element YTG 10.2013 is defined as the consolidation element YTG 11.2013 + the N level element 10.2013
and so on until you reach
The consolidation element YTG 02.2013 which is defined as YTG 03.2013 + 02.2013

In that way you get the value that you want by selecting the combination of the DongThu element, and the YTG 02.2013 element.
Hi Mr Alan Kirk!
I do it work, but with my DimensionYear i must wire rules for one box, it that means i have to write 12 month * 5 year fomular, i would write alittle than more, can you give me a solusion for rules or re-designs my DimensionYear

Thanks alot!!
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: How to write sum function

Post by lotsaram »

blusky_1010 wrote: Hi Mr Alan Kirk!
I do it work, but with my DimensionYear i must wire rules for one box, it that means i have to write 12 month * 5 year fomular, i would write alittle than more, can you give me a solusion for rules or re-designs my DimensionYear

Thanks alot!!
It should be possible to write a generic rule as opposed to hardcoding the "lookups" for each specific case. This might be possible simply via naming convention and combination of SubSt and concatenation or you might need a lookup attribute or lookup cube but it will definitely be possible. However unless you post some ACTUAL CODE and the exact cube dimensionality then it isn't going to be possible to provide assistance.
blusky_1010
Posts: 5
Joined: Tue Mar 19, 2013 2:37 am
OLAP Product: IBM Cognos TM1
Version: 10.1.1
Excel Version: 2007

Re: How to write sum function

Post by blusky_1010 »

lotsaram wrote:
blusky_1010 wrote: Hi Mr Alan Kirk!
I do it work, but with my DimensionYear i must wire rules for one box, it that means i have to write 12 month * 5 year fomular, i would write alittle than more, can you give me a solusion for rules or re-designs my DimensionYear

Thanks alot!!
It should be possible to write a generic rule as opposed to hardcoding the "lookups" for each specific case. This might be possible simply via naming convention and combination of SubSt and concatenation or you might need a lookup attribute or lookup cube but it will definitely be possible. However unless you post some ACTUAL CODE and the exact cube dimensionality then it isn't going to be possible to provide assistance.
Dear Mr Alan Kirk !
My cube have three Dimension: DimensionYear, DuAn, NhuCauVon as the picture i posted behind, and i must caculation with Sum funtion in Excel, i had built the Cosolidate Year Go To as you say, but i get a problem with sum funtion opposite dimension
Ex: O26=SUM($C$26:N26)
and O22= sum(P22:$BV$22)
What can i do?
please help me,
thanks so much!
Post Reply