Cumulative SUM based on Measure FROM LOWER to HIGHER

Hello,
I tried to find some post like mine but i did not find it.
I have this scenario:
Filter
Cod Store
Value
Cenario 1
City: RJ
1112
574924.05
Type: Infantil
1449
617860.04
Store: Carrefour
1023
873678.53
But i need to create a new calculated member based on VALUE from LOWER to HIGH making a cumulative sum like this:
Filter
Cod Store
Value
What i NEED
Cenario 1
City: RJ
1112
574924.05
574924.05
Type: Infantil
1449
617860.04
1192784.09
Store: Carrefour
1023
873678.53
2066462.62
Here it is ordered by VALUE already, but in my cube is may not be. Can someone help me? i trying many ways but no one works fine.
<b>Fabrizzio A. Caputo</b><br/> Certificações:<br/> MCT<br/> MCC<br/> Oracle OCA 11g<br/> MCITP SQL Server 2008 BI<br/> MCITP SQL Server 2008 Implementation and Maintenance<br/> MCITP SQL Server
2008 Developer<br/> ITIL V3 Foundation <br/> Blog Pessoal: <a href="http://fabrizziocaputo.wordpress.com">www.fabrizziocaputo.wordpress.com</a><br/> Email: [email protected]

Hi Fabrizzio,
Most of the running total snippets you will find in the forums contains elements like currentmember, prevmember or ranges [A : B] that also refers to members.  Unfortunately the relative position of those elements  are extracted from the hierarchy
level  of the correspondent members as defined in the cube dimensions and not from the ordered (query scope) set.
The usual solution is to define a measure as the rank in the ordered set and take  the cumulative sum with head ():   sum(  head( ordered set, till the rank) , by the value measure ).
If you choose the recursive solution for the running total you could use item() in combination with rank: maybe something like orderedset.item(rank measure) as an ersatz of currentmember.
Philip,

Similar Messages

  • Mdx : Sum up the measure from start but need only non empty rows

    Hi All
    i have created a calculated measure where it suming up all its previous avaialable values based on Date dimension.
    Everything is working but we are getting all rows from that datetimension . how can get only till current date,
    SUM(NULL:[Date].[Hierarchy].currentmember,[Measures].[SIMID])
    Surendra Thota

    Hi Surendra,
    According to your description, you want to calculate the sum up the measure from start for those non empty rows, right?
    In this case, please try the query below.
    WITH MEMBER [Measures].[Sum from start]
    AS
    SUM ({NULL:[Date].[Calendar].CurrentMember},
    [Measures].[Internet Sales Amount])
    SELECT {[Measures].[Internet Sales Amount],[Measures].[Sum from start]} ON 0 ,
    nonempty([Date].[Calendar].[Calendar Year].MEMBERS) ON 1
    FROM [Adventure Works]
    Result
    Besides, here is a blog which describe various way to calculate running total, please see:
    http://blog.sqltechie.com/2011/01/various-way-to-calculate-running-total.html
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Velocity measurement from low resolution encoders

    Hi, I have 1024 pulse/1rotation encoders. I want to calculate or estimate angular velocity from this low resolution encoders. When I use dx/dt(derivative.vi)  there are high and low readings which obviously seem wrong to me.I want to have a more smooth and accurate reading(and without much delay). Is there an efficient and accurate way of reading velocity measurements from this low resolution encoders? FOr example does Ni/Motion help? Or is there a velocity measurement .vi ?
    Thank you.

    As far as I remember (*) , the FP-QUAD will measure the velocity by counts during a fixed time slot. The maximum time is (was?) 26.??ms.
    Your resolver has 1024 pulses (I assume 2 pulse streams with 90° shift) , the QUAD will count pulse edges, so you get 4096 counts per revolution. Together with the integration time (26.??ms), you get a resolution of 38.15 counts/s (See manual of the FP-QUAD) or an error of +/- 0.559 RPM
    Of course you can read the 32bit counter of the QUAD in a user defined time periode and calculate the velocity.
    If you have real slow movements, you can measure the time between each pulse. The accuracy will depend on the quality of your resolver and the resolution of your timer, however I think this couldn't be done with the FP-QUAD.
    * My last task with FP-QUAD was 4 years ago, maybe new firmware and driver give you more choices now
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • Organizing data from low to high?

    Hi Community,
    I'm totally out of numbers and such, but I need to organize some data from low values to high values automatically, like for example, the earnings in 12 months, which are always variables but I would like to organize them from the lower to the higher. Is there a way to organize this automatically?
    Thanks in advance,
    Mart

    Mart,
    Would sorting your rows by column content do it for you?
    Jerry

  • Rollup of Scores: From lower to higher context

    Hi Everyone,
    Would it be possible that for each scores on the balance scorecard be rolled up according to the hierarchy of the context? So that on the top most hierarchy of the Context we will have an overview across context which perspective is behind...
    Thank you in advance.
    Rally

    Rally,
    With multi-dimensional modeling you can build a dimension based on your contexts and use that when dimensioning data. While in BW a key figure is neccessarily dimensioned by every characteristic in the dimension tables, in PAS, every measure can be dimensioned differently. For example, Sales can be dimensioned by Customer, Customer Group, and Product, while Costs can be dimensioned by just Customer Group and Product. So you have the flexibility of just choosing those measures (or key figures) you would like also dimensioned by Context.
    Regards,
    Bob

  • Rman backup from lower and higher versions

    Hi all,
    we have three database one db in 8.1.0.6.0 and another 9.2.0.8.0 and another 10.2 database. Can i backup using 9i rman to lower version 8i and 10G using same catalog created in 9i ?

    Please check about compatible
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/compat002.htm

  • Why does my macbook pro LED backlight keep going from low to high on it's own?

    So this has happened to me I think once or twice before.. I'll be using my macbook and all of a sudden it's LED backlight goes dim. Then I have to change it back so it's in the middle (not too dim, not too bright). Then a couple minutes/seconds later the LED backlight goes to it's brightest.. It's making me mad that it's doing this and I don't know why it's doing what it does. All of this is happening while I'm scrolling down a webpage, typing, or just physically doing something on the keyboards. So it's not because it's about to go to sleep. I always keep the LED backlighting in the middle so it doesn't waste too much battery. So why is it doing this? Help me please?

    There is an ambient light sensor built in the the MBP.  If it is annoying , open SYSTEM PREFERENCES>DISPLAYS>DISPLAY.  Uncheck the box for 'Automatically adjust brightness as ambient light changes'.
    Ciao.

  • Change photo from low to high resolution

    Can Photoshop take a 72 dpi photo and turn it into a 300 dpi phot?

    Yes, but depends on your expectations?  DPI is just dots per inch for a printer command.  It does nothing to the base resolution.  One can not manufactor more resolution that it was shot at.

  • Sum based on Number values in a Char string..

    i have a requirement
    i have a field on my form, designed in form6i (oracle 10g)
    my tables are;
    with t1 as (
                select 101 t1_code,'it101' t1_itcode, 10 t1_qty, 5.5 t1_prc from dual union all
                select 101,'it102',  5 , 3 from dual union all
                select 102,'it102', 10 , 3 from dual union all
                select 102,'it104', 10 , 5 from dual union all
                select 103,'it101', 10 , 5.5 from dual)
    select * from t1;
    with t2h as (
                select 11 t2h_no, 101 t2h_code from dual union all
                select 12 , 101  from dual union all
                select 13 , 102  from dual union all
                select 14 , 103  from dual )
    select * from t2h;
    with t2d as (
                select 11 t2d_no, 'it101' t2d_itcode, 5 t2d_qty from dual union all
                select 11 , 'it102', 5 from dual union all
                select 12 , 'it101', 5 from dual union all
                select 13 , 'it102', 5 from dual union all
                select 13 , 'it104', 5 from dual union all
                select 13 , 'it102', 5 from dual union all
                select 13 , 'it104', 5 from dual union all
                select 14 , 'it101', 10 from dual)
    select * from t2d;t1_CODE , t2h_no and t2d_no are fields Number datatype.
    var m_x varchar2(20);
    exec :m_x :='11,12';
    lets say the value of m_x (t2d_no) is 11,12
    i want the query to sum t2d_qty for t2d_no 11 & 12 and put 1 t1_prc in the resultant row
    based on the matching t1_itcode with t2d_itcode
    the result should be like this for m_x = 11,12
    T1_IT        T1_QTY        T1_PRC
    it101        15.000         5.500
    it102         5.000         3.000
    if m_x hold just 11 then it should return just;
    T1_IT        T1_QTY        T1_PRC
    it101         5.000         5.500
    it102         5.000         3.000if m_x hold just 11,13 then it should return an error msg
    as the t2h_code is not the same for t2d_no 11 & 13;
    kindly suggest..
    TY

    I tried to solve the puzzle. But I'm already confused on the requirement. On what fields do you want to join and what fields to sum....??
    I did this, but then I got lost.... maybe you can use it as a start to define "join" and "sum" ... conditions.
    with t1 as (
                select 101 t1_code,'it101' t1_itcode, 10 t1_qty, 5.5 t1_prc from dual union all
                select 101,'it102',  5 , 3 from dual union all
                select 102,'it102', 10 , 3 from dual union all
                select 102,'it104', 10 , 5 from dual union all
                select 103,'it101', 10 , 5.5 from dual),
    t2h as (
                select 11 t2h_no, 101 t2h_code from dual union all
                select 12 , 101  from dual union all
                select 13 , 102  from dual union all
                select 14 , 103  from dual ),
    t2d as (
                select 11 t2d_no, 'it101' t2d_itcode, 5 t2d_qty from dual union all
                select 11 , 'it102', 5 from dual union all
                select 12 , 'it101', 5 from dual union all
                select 13 , 'it102', 5 from dual union all
                select 13 , 'it104', 5 from dual union all
                select 13 , 'it102', 5 from dual union all
                select 13 , 'it104', 5 from dual union all
                select 14 , 'it101', 10 from dual)
    select t1.t1_itcode,sum(a.t2d_qty)t2d_qty ,sum(t1.t1_prc)t1_prc
    FROM
    (select t2d.t2d_no,sum(t2d.t2d_qty) t2d_qty
    from t2d
    inner join t2h
    on (t2d.t2d_no=t2h.t2h_no)
    where t2d.t2d_no in (11,12)
    group by t2d.t2d_no
    ) a
    inner join t1
    on (t1.t1_qty = a.t2d_qty )
    group by t1.t1_itcode, t1.t1_prc;

  • How to find the cumulative Sum

    How to get the fastest result in 180 million records table to get the BTN(BillingTelephoneNbr) wise MonthlySalesCost.
    select B.BTN,b.cost,sum(a.cost) as cum_sal
    from Monthly_BTN a,Monthly_BTN b
    where a.rowid <= b.rowid
    group by b.rowid,b.BTN,b.cost.
    Above query is taking up the too much time.
    Option:-
    a) partition the table
    b) rebuild the index
    c) alter the index
    d) any other suggestion??
    Let me know the best way.

    I don't understand why you need a self-join.
    See the following example, with cumulative sum about deptno :
    SCOTT@demo102> ed
    Wrote file afiedt.buf
      1  select empno, deptno, sal, sum(sal) over (partition by deptno order by empno)
      2  from emp
      3* order by deptno , empno
    SCOTT@demo102> /
         EMPNO     DEPTNO        SAL SUM(SAL)OVER(PARTITIONBYDEPTNOORDERBYEMPNO)
          7782         10      24500                                       24500
          7839         10      50000                                       74500
          7934         10      13000                                       87500
          7369         20       8000                                        8000
          7566         20      29750                                       37750
          7788         20      30000                                       67750
          7876         20      11000                                       78750
          7902         20      30000                                      108750
          7499         30      16000                                       16000
          7521         30      12500                                       28500
          7654         30      12500                                       41000
          7698         30      28500                                       69500
          7844         30      15000                                       84500
          7900         30       9500                                       94000
    14 rows selected.
    SCOTT@demo102> So, your query would be :
    select BTN,cost,sum(cost) over (partition by BTN order by BTN,cost) as ***_sal
    from Monthly_BTN
    order by BTN,cost;Anyway, a query without where clause on a huge table (180 million records) seems to me like a little strange, are you sure that you will read all rows ?
    Nicolas.
    partition or not partition about BTN... like you want.
    Message was edited by:
    N. Gasparotto

  • Measures from dimension table

    Hi,
    Here is part of my logical layer (BMM):
    Dim - Time: TIME_KEY, ...
    Dim - Client: CLIENT_KEY, ...
    Fact - Encounters: # Visits ( i.e., count(distinct(EVENT_ID) )
    The above fact table contains foreign keys (TIME_KEY, CLIENT_KEY, etc.) to all dimension tables in the physical layer.
    My requirements:
    I need to generate a pivot report that has the following information:
    Rows: Translated categories based on # Visits (from Fact - Encounters)
    Columns: Fiscal Year (from Dim - Time)
    Measures: # distinct Clients (from Dim - Client)
    Somehow I could only get the correct measures when I used aggregation rule=count distinct for the CLIENT_KEY column in the "Dim - Client" table in the "presentation layer". However, I know this is not the right way to do that because all measures should be calculated based on the "fact" tables. Then, I even tried to create a logical fact table based on the same source as the "Dim - Client" table but got all zeros in the measures. Does anyone know the correct way to implement this logical layer?
    Thanks.
    Andy

    Can anyone help?
    Thanks.
    Andy

  • How do I get Illustrator to measure from centerline?

    Would like to input measurements in transform palette of a rectangle, and have that rectangle be placed with out concern for stroke width. Just to be measured from centerline of stroke/path, ala FreeHand. Is there a pref for "measure from center" or similar that I am missing.

    Hi there...
    If I type in the transform palette, X:0  Y:0  W:1in  H:1in     for a shape, it will give me a square based on the width of the shape including the stroke. In my mind that is not a one inch square because if I change the stroke it is no longer 1" square. I would like to base the measurements on the centerline of the path.

  • Maintenance Orders based in measurement documents

    Hi SAP Gurus,
    I need to plan PM Orders based on measurement documents.
    Imagine that I have a device to record temperature. The normal tempure is 25ºC. What I wan't is to open Maintence Orders when the temperute changes to 26ºC or 24ºC.
    Now, in order to do this I cannot make a counter, only a measurement document, because I want to keep a record from temperetures.
    But the problem is that if I record this as a measurement document, and not as a counter, I cannot make Single Cycle Plans....
    Can you help me?
    Thanks in advance.

    Hi
    IMRC0001 - this user exit will help u to create a notification.. once the measurement docs are apdated...
    Normally.. it was useful for counter based measurement... since.. once the running hours are entered a notification is created and corresponding u can create a order...check out.. if it can be used to measurement point...i hope it should be used...
    I am not sure abt that
    - Pithan

  • Hi, I can't found on where the price different receipt from lower level come from. Please help.. Thanks a lot in advance..

    CKM3
    Category
    Quantity
    Unit
    PrelimVal
    Price Diff
    ExRt Diff
    Price
    Currency
    Beginning Inventory
    419
    KG
    18,841.59
    4,798.81
    -0.09
    56,420.79
    MYR
    Period Opening
    419
    KG
    18,841.59
    0.00
    0
    44,968.00
    MYR
    2000050719 Post closing material ledger
    0
    KG
    0.00
    4,798.81
    -0.09
    0.00
    MYR
    Receipts
    1,225.00
    KG
    55,085.80
    27,733.41
    -0.03
    67,607.49
    MYR
    Production
    1,225.00
    KG
    55,085.80
    27,733.41
    -0.03
    67,607.49
    MYR
    5000125874 Receipts from Lower Levels
    0
    KG
    0.00
    26,620.23
    -0.03
    0
    MYR
    1002200029 Order Settlement 1183964
    0
    KG
    0.00
    1,113.18
    0
    0.00
    MYR
    1002183596 GR for order 1183964/1
    1,225.00
    KG
    55,085.80
    0.00
    0.00
    44,968.00
    MYR
    Cumulative Inventory
    1,644.00
    KG
    73,927.39
    32,532.22
    -0.12
    64,756.38
    MYR
    Consumption
    225
    KG
    10,117.80
    4,452.40
    -0.02
    64,756.36
    MYR
    Not Allocated
    0
    KG
    0.00
    4,452.40
    -0.02
    0.00
    MYR
    Consumption
    225
    KG
    10,117.80
    0.00
    0
    44,968.00
    MYR
    1002191063 GD goods issue:delvy 601
    200
    KG
    8,993.60
    0.00
    0.00
    44,968.00
    MYR
    1002183646 GD goods issue:delvy 601
    25
    KG
    1,124.20
    0.00
    0.00
    44,968.00
    MYR
    Ending Inventory
    1,419.00
    KG
    63,809.59
    28,079.82
    -0.10
    64,756.38
    MYR
    5000125874 Multilevel Price Determination
    0
    KG
    0.00
    26,715.16
    -0.10
    0.00
    MYR
    4000046771 Single-Level Price Determinati
    0
    KG
    0.00
    1,364.66
    0.00
    0.00
    MYR

    Hi
    Please, address your question to SCN PP Space http://scn.sap.com/community/erp/manufacturing-pp/content
    Br, Alex

  • How to find the Sum based on Like Dates

    Hello everyone,
    Column 1 contains "Date Sent", Column 2 contains "Dates of Service" and Column 3 contains the payment "Amount" in USD. I want to write a formula that will total up the sum of payment values from column 3 based on the date of payment (Column 1).
    Thanks!
    Jared

    Hi Jared,
    This will do what's illustrated in your example, but has a few restrictions:
    The dates must run in ascending order.
    To get a total for the last date, a later date (with no corresponding amount) must be entered after the last transaction.
    Formula:
    Entered in D2, and filled down the rest of column D:
    =IFERROR(IF(A3>A2,SUMIF($A,A2,C),""),"")
    IFERROR is used to suppress the error message that arises from the formula in D10 referencing a cell in D11.
    Regards,
    Barry

Maybe you are looking for

  • Can't modify TNS timeout on database client outgoing request  -

    Dear all, I have two Oracle Database connected by dblink over TCPIP. One is a client for the other. When my client application (in db client) try to retrieve data from the db server and this one is shutdowned, It receives this message ORA-12535 "TNS:

  • Cant play any flash player content on IE 8 or Firefox

    Can't play any flashplayer content, on IE 8 it tries to load but never does on Firefox it tells me to upgrade Adobe flash and when I try that, the installer gets to around 20% to 25% and then times out. I've tred all I know, please help

  • Best approach to replicate the data.

    Hello Every one, I want to know about the best approach to replicate the data. First i clear the senario , i have one oracle 10g enterprise edition database and 20 oracle 10g standerd edition databases.The enterprise edition will run at center and th

  • Time and Travel Integration

    Hi Friends can you suggest me how to achieve integration between time and travel? All i want is when the employee is traveling, the 2002 attendance also need to be updated so the employee is not counted as absence without notification. I've been sear

  • Saving a drawing as vector file?

    I am new to Adobe Ideas--how can I save a drawing as a vector file? or a PDF that is editable in Illustrator CS6?