Cumulative values for any level of a time dimension

Hello,
I want to have a calculated cumulative member working for all levels of a fiscal time hierarchy, YTD, QTD, MTD, WTD.
I can get a column to work for a specific level like that
Aggregate
  PeriodsToDate
     [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ],
     [Calendar].[Hierarchy - Year to Week].Currentmember
  ), [Measures].[Billing Net USD]
However what I need is to show the to date whatever level of the dimension is displayed relative to that level. SO if all level are displayed, each intermediate level shows the cumul relative to that level.
I Would really appreciate some pointers to an article or example on how I can do this. Thanks
Thanks/Regards, Philippe Cand

Hi P,
One way to solve this (there are always many ways, each having varying levels performance and simplicity).
CASE
WHEN [Calendar].[Hierarchy - Year to Week].Level is [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ] THEN 
Aggregate(PeriodsToDate(
     [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ],
     [Calendar].[Hierarchy - Year to Week].Currentmember), [Measures].[Billing Net USD])
WHEN [Calendar].[Hierarchy - Year to Week].Level is [Calendar].[Hierarchy - Year to Week].[Fiscal Period YYYYP] THEN 
Aggregate(PeriodsToDate(
     [Calendar].[Hierarchy - Year to Week].[Fiscal Period YYYYP],
     [Calendar].[Hierarchy - Year to Week].Currentmember), [Measures].[Billing Net USD])
WHEN [Calendar].[Hierarchy - Year to Week].Level is [Calendar].[Hierarchy - Year to Week].[Fiscal Week YYYYWW] THEN 
Aggregate(PeriodsToDate(
     [Calendar].[Hierarchy - Year to Week].[Fiscal Week YYYYWW],
     [Calendar].[Hierarchy - Year to Week].Currentmember), [Measures].[Billing Net USD])
WHEN [Calendar].[Hierarchy - Year to Week].Level is [Calendar].[Hierarchy - Year to Week].[Fiscal Day YYYYDDD] THEN 
Aggregate(PeriodsToDate(
     [Calendar].[Hierarchy - Year to Week].[Fiscal Day YYYYDDD],
     [Calendar].[Hierarchy - Year to Week].Currentmember), [Measures].[Billing Net USD])
    else null
    end
Hope that helps,
WHEN [Calendar].[Hierarchy
- Year to Week].Level is [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ] THEN Aggregate
  PeriodsToDate
     [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ],
     [Calendar].[Hierarchy - Year to Week].Currentmember
  ), [Measures].[Billing Net USD] 
WHEN [Calendar].[Hierarchy
- Year to Week].Level is [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ] THEN Aggregate
  PeriodsToDate
     [Calendar].[Hierarchy - Year to Week].[Fiscal Quarter YYYYQ],
     [Calendar].[Hierarchy - Year to Week].Currentmember
  ), [Measures].[Billing Net USD] 
Richard

Similar Messages

  • SQL Query to find cumulative values for a Financial Year

    Dear users,
    My requirement is to create a SQL query for a table/view where I have day-wise data. I want to find out cumulative values for financial year by giving any date. It should add the values from start of financial year till that date in the financial year.
    I think creating a view of such type will post heavy burden on resources since accuimulation will be done for each day upto that day.
    Thanks

    Dear users,
    My requirement is to create a SQL query for a
    table/view where I have day-wise data. I want to
    find out cumulative values for financial year by
    giving any date. It should add the values from start
    of financial year till that date in the financial
    year.
    I think creating a view of such type will post heavy
    burden on resources since accuimulation will be done
    for each day upto that day.
    ThanksKumar's solution will serve yours purpose but m not agreed
    I think creating a view of such type will post heavy
    burden on resources since accuimulation will be done
    for each day upto that day. Khurram

  • Using cumulated values for further calculation in a bex report

    Hi ya'll,
    I have a problem with using cumulated values in a bex report.
    the report has three lines:
    Values 1:    100    200  300
    Values 2:    10      5     40
    Values 3:    1000  500  4000
    The values of row 3 is a formula multiplying the values from row 1 and 2... My problem is that the values of row 3 are wrong - for example 200*5 isn't supposed to result in 500 !!
    I figure the reason is that the values of row 1 is a cumulated result, meaning the <i>actual</i> value of the second column of the first row i 100 (and not 200).
    How can I ensure that my formula for row 3 uses the <b>cumulated</b> result from row 1, instead of the underlying result ?.

    Create a column structure with Actual Value columns as well as cumulated value columns. Hide Actual Value Columns from display.
    Example :
    Actual1 | Actual 2 | Actual 3 | *** 1 | *** 2 | *** 3 |
    100 | 100 | 100 | 100 | 200 | 300 |
    You can create a forumla to calculate Value 3 : (Actual 1 * Value 2 ).
    I guess you are using Cell Referencing to achieve this.

  • Generating MD5 hash value for any specific flat file

    Hi experts,
    I am developing a program that will generate flat files and also I should generate the MD5 Hash value for each and every flat files. My question is how can I generate the MD5 hash value for the generated .txt files.
    Thanks in advance
    Shabir

    You can use functions
    MD5_CALCULATE_HASH_FOR_CHAR for text file
    MD5_CALCULATE_HASH_FOR_RAW for binary

  • Cumulative Value for calculation in Formula

    Hi All,
    We have a requirement to use a formula based onthe cumulation of Keyfigures in the report.
    The scenario is like this
    KF1  KF2    ***(KF1)  ***(KF2)     Fornula1 = ***(KF1) / *** (KF2)
    10     2       10                     2           5
    20     3       30                     5           6
    30     4       60                     9           6.7
    40      5      100                   14          7.1
    while we can display cumlative values of KF1 and KF2 in reports by using the calculation tick the cumulative valuses cannot be used in formula
    Is there any work around

    Hi,
    As you now know that cumulated Kfs cannot used in a formula, why don u try creating cumulated Kfs using some Time chracteristics?
    Like this you can hard code the cumulation.
    You can use SAp exit variables on Time characteristics to keep these values dynamic.
    Hope this helps,
    Sharmishtha

  • Different variable values for same query inserted 6 times in One workbook.

    Hi,
    We have one workbook with the same query inserted on 6 different tabs (sheets in excel), a variable on Business Unit that is different for each tab.
    How can we control the variable input in BW2004s such that the different BU values are processed for each tab.
    At present the BU value input in the "variable pop-up screen" over rides all the fixed variables on the different tabs.
    Generous points will be awarded for useful solution.
    Thanks,
    Jasmine

    Hi,
    I am  trying to use filters for executing 2 queries in a Web App. I have 2 dataproviders (one for each query), and I am trying to use filters for say Version.
    The URL is
    /sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=ZTW_XXX&DATA_PROVIDER_1= DP1&FILTER_IOBJNM_1=0VERSION&FILTER_VALUE_1=F01&DATA_PROVIDER_2= DP2&FILTER_IOBJNM_2=0VERSION&FILTER_VALUE_2=F02.
    This doesnot work. Both queries get filtered on both 'F01' and 'F02'.
    I am trying to filter DP1 by F01 and DP2 by F02.
    Any help is appreciated.
    Thanks,
    NS

  • Select Filter value for Hierarchy node taking long time

    Dear Experts,
    I am facing an issue with the Filter value selection in a BEx query and searched the forum for a solution but found none.
    I have a free characteristic with hierarchy enabled for it and the Filter value selection at Query execution has been set to 'Values in Master data table' in the query definition and in the Multiprovider as well.
    However, whenever the filter value selection is performed, the values are being read from teh underlying infocubes instead of the Master data.
    We tried checking the BIA Index for the cube as well as the InfoObject and all is fine.
    Can someone please point what might be going wrong here.
    Thanks & Regards,
    Sonal

    Could you please check as per Note 1565809 and make sure the F4 mode is really M mode in each level settings?

  • Help!Traded baseline retina for mid-level. Used time machine to restore files but now time machine ridiculously slow. WHY??

    I recently traded my basline macbook pro with retina dipslay for the mid level to gain a bigger SSD. I used my time machine backup on my Lacie Porsche Design 2TB external hard drive. It worked seamlessly and new computer is up and running perfectly. BUT now my time machine backups are painfully slow. Like 5KB per 30 minutes slow! When i ran my first initial backup it took about 45 minutes to do a full backup of about 110GB (on my baseline retina display with the exact same Lacie External drive) ... Now time machine wants to do the same thing (a full new backup because its a new computer) but it is so slow it is pretty well not doing anything at all. HELP! Is it the external drive or the computer or something i am doing wrong??

    See Pondoni's tip - Backup is slow or seems "hung" - maybe it will be of some assitance.
    Clinton

  • Non-cumulative value KF

    Hi:
    I have given the Aggregation as SUM  and the Excepiton Aggregation as Last Value for a non-cumulative KF Quantity Total Stock  for Inventory. I am using Non-cumulative value with in- Receipt Quantity Total Stock and out-flow Issue Quantity Total Stock. Then I can calculate Quantity Total Stock  in Query.
    But I have another requirement, I want to a KF to count  0Material  whose Quantity Total Stock not equal 0.  In fact, for a Non-cumulative value, the Aggregation reference char of  KF Quantity Total Stock   is 0calday, but what I want is 0Material.  How could I create such KF?
    Many thanks in Advance!
    Points will be assigned!

    Hi,
    The basic purpose of Non-cumulatives is to get the values for them depending upon the Time Characterestics alone and not on any other characterestics. As far as I know you cant use 0MATERIAL as the aggregation reference Char.

  • Non-cumulative value Parameters EFFECT

    Hi,
    I am customizing the 0IC_C03 inventory cube to get to the reports we need. But the query performance is extremly slow. We do not have BI Acceleratior, but aggregates are build for my query. So I duplicated the cube and removed 0MATERIAL from the non-cumulative parameter value for the cube, and have only 0CALDAY and 0PLANT. When I run the same query it runs way faster than before. All I did was remove the 0MATERIAL as one of the possible parameters.
    I would like to know the role of these parameters and the effect of not having 0MATERIAL as one of the parameter value.
    Anyone know why the performance difference?
    Also looking at the /BIC/ZL* cube with 0MATERIAL, the record counts are as high the material count. Now after removing the same table has lot less records.
    Could anyone explain about this?
    Thanks,
    Arthur.

    Hi,
    The basic purpose of Non-cumulatives is to get the values for them depending upon the Time Characterestics alone and not on any other characterestics. As far as I know you cant use 0MATERIAL as the aggregation reference Char.

  • User wants to get the cumulative values based on his input.

    Hi
    I am working one FI Report; the out put values are Cumulative values for Current, Previous years. I developed and it fetches the data last 3 years Cumulative year’s data without any input FYMonth based on SAPexits and varible offsets. But user wants to put Fiscal year Month as input. So he wants get the cumulative values based on his input. For example, If his input SEP'2005(062005), Then Query gives the Output Cumulative Value (I.e., Sum of Total values of Form APR'2005 to SEP'2005)
    Please provide the solution…
    Thanks
    Mannev

    Mannev,
    You can try doing this.
    1. If the user input is fiscal period(2005006) , you can create a customer exit variable which will take the user value (i_step =2), and change the variable value to 20005001. (this is a simple code where tye last 2 digits are replaced by 01).
    if the user is entering calmonth, you can use FM - DATE_TO_PERIOD_CONVERT, to convert the month to fiscal period.
    2. You can create a rkf with restrictions on time char based on the customer exit variable and the user entered variable.
    -Saket

  • MIS report : Daily Cumulative Report for contract in SD module

    Hi All,
               Do you have any idea about MIS report in SD module.actually my requirement is that
    i have to generate daily cumulative report for contract. that means at time i am selecting ten plants
    and correspondingly sum of  total quantity,average rate and average weight of all the contracts for particular plant  should be displayed in a column and various existing flavours should be displayed in a row.
    for above requirement following output format is there:
    plant ->           plant1               plant2              plant3 ....   .....
    flavour             quantity  rate     quantity  rate
    cumulative
    total cumulative
    please refer sample code,if any.
    Thks & Regards
    Shailesh

    Hi,
    You can ask your functional people what are the required fields to develop a report below are the table.
    customer related tables:
    KNA1 Customer master General Data
    KNB1 Customer Master – Co. Code Data
    KNKK Customer Master Credit Control Area Data
    KNVV Sales Area Data
    KNVI Customer Master Tax Indicator
    KNVP Partner Function
    KNVD Output type
    KNVS Customer Master Ship Data
    KLPA Customer/Vendor Link
    Sales Documents
    VBAK Sales Document - Header Data
    VBAP Sales Document - Item Data
    VBUK Header Status and Administrative Data
    VBKD Sales Document - Business Data
    VBUP Item Status
    VBPA Partners
    VBFA Document Flow
    VBEP Sales Document Schedule Line
    VBBE Sales Requirements: Individual Records
    Delivery Document
    LIKP Delivery header table
    LIPS Delivery item table
    Billing document:
    VBRK Billing document header table
    VBRP Billing Document Item table
    Shipping
    VEKP Shipping Header Table
    VEPO Shipping Item Table
    Thanks
    VIkranth

  • Cumulative value calculation in script logic

    Hi,
      Assuming i have the following values:
    Acc1, time1 = 2
    Acc1, time2 = 10
    Acc1, time3 = 20
    Acc1, time4 = 30
      What script logic can i write such that the end results are:
    Acc2, time1 = 2
    Acc2, time2  = 12
    Acc2, time3 = 22
    Acc2, time4 = 32
      time1 could start from any month of the year, and the next month is always one month after the current month (i.e. if time1 = june, then time2 = july).
      Basically the above calculation involves some sort of cumulative effect. I would like to have this cumulative amounts stored in the database, hence i don't want to rely on measures="ytd" in the report.
    Cheers

    Hi Raja,
    You can get the daywise cumulative value for the user selected date range by creating a formula on the KF & turning on the 'Cumulated' checkbox in the 'Calculations' tab.
    --Priya

  • V$sqlarea and cumulative values

    hi gurus,
    does v$sqlarea provide cumulative values for a SQL?
    for eg:
    Step 1
    SQL=select * from emp where empid=1
    elapsed_time = 2829
    Step 2
    SQL=select * from emp where empid=1
    elapsed_time = 2980
    1) if the values are cumulative, is there a way to find the elapsed_time for the last executed SQL as in step 2?
    2) is there any limit for the number of rows returned by v$sqlarea,(or when would be a particular SQL cleared from v$sqlarea)?
    thanks,
    charles

    SELECT sql_text,
          executions,
          CEIL (cpu_time / GREATEST (executions, 1)) ave_cpu_time,
          CEIL (elapsed_time / GREATEST (executions, 1)) ave_elapsed_time,
          CEIL (disk_reads / GREATEST (executions, 1)) ave_disk_reads,
          persistent_mem per_mem,
          runtime_mem run_mem,
          CEIL (sorts / GREATEST (executions, 1)) ave_sorts,
          CEIL (parse_calls / GREATEST (executions, 1)) ave_parse_calls,
          CEIL (buffer_gets / GREATEST (executions, 1)) ave_buffer_gets,
          CEIL (rows_processed / GREATEST (executions, 1)) ave_row_proc
    FROM v$sqlarea
    WHERE sql_text = 'select * from emp where empid=1'Regards,
    Mahesh Kaila

  • How to write data to the DAQ for a specified length of time while still reading the input data?

    Hello,
    I'm using labview 2012 and am trying to turn on a signal for a specified length of time in labview at the press of a button. The signal goes into an AO (PXI 6723) through my system, where the voltage gets divided by 2, the read in through the AI (PXI 6225). I want to write and read voltage constantly and then have a spike of voltage after pressing a button in LabView while still reading the voltage value for the specified amount of time.
    Parameters:
    constant voltage of 1 volt to Analog output (reading and writing) seen through a waveform chart.
    for 1 second, turn on 3 volts and see the response on the waveform chart.
    My specified delay time does not match the elapsed time. I am having difficulties doing this. I have attached the VI.
     ( I can't upload a functional VI since it shows "the contents of the attachment doesn't match its file type") How can I attach the VI?.
    Thanks!
    Eduardo

    Mike,
    Thank you for your reply! I greatly appreciate it. I currently don't have any DAQmx timing in my application. I tried using it and, without really understanding how it works nor how to manipulate it, the whole test end up taking a long time to change the values i.e. too slow.
    The DAQmx timing I used was the sample clock since it was for analog signals, but I don't really understand the buffer, what that means nor how to use it. inputting a rate time for it also made my test slower. The rate time is the samples per channel per second, but I'm not sure how to determine a number so that I am collecting the data I need and take into account aliasing.
    I know the PXI 6225 has the capability to read 250kS/s (which I am assuming it's kilosamples per second or 250,000 samples per second). I am using 32 differential channels. I have read that I have to divide the maximum sample rate by the number of channels, (250kS/s / channels) but I don't know if I should count the number of total channels (64) or differential channels(32). In other words, is the per-channel maximum rate:
    250,000/32 = 7,812.5 samples per channel per second, or
    250,000/64 =3,906.25 samples per channel per second
    Furthermore, If I know the number of samples per channel per second, how can I implement that knowledge to the DAQmx sample clock so that my sampling is as fast and as accurate as it can be?
    I attached an image of my DAQmx functions in my code, I merged all the stacked sequence structures in paint so you can see them.
    thanks for your help!
    Eduardo
    Attachments:
    DAQmx tasks.jpg ‏211 KB

Maybe you are looking for