Sum from current date to the last date of sales

Hi 
It's been a while since I used MDX last time. 
I have a simple question (probably). I need a measure which sums up from the current date to the last sale date. 
It's like a reversal of Year To date.  And I need to do it date level. 
Let's say is the sales goes like
1/May/2000     $1000
2/May/2000     $1000
3/May/2000     $1000
4/May/2000     $1000
5/May/2000     $1000
I need to create a measure which displays sum of current sales and last sales
1/May/2000     $5000  
2/May/2000     $4000
3/May/2000     $3000
4/May/2000     $2000
5/May/2000     $1000
I have a date hierarchy and hope it can be rolled up. 
And I tried like something like ( suggested in another posting)
[Date].[Calendar].CurrentMember:NULL}
But this does not work for me.
The actual MDx I wrote is 
With member MEASURES.ActiveLicences as 
sum ( 
{[License Expiry Date].[FinancialYear].[YY-MMM].CurrentMember: null},
[Measures].[No of Students]
select {
MEASURES.ActiveLicences,
[Measures].[No of Students] } on columns, 
[License Expiry Date].[FinancialYear].[YY-MMM].members on rows 
from [Sales];
Can anyone help me with this please? 
Kind regards
Mark Kim

Hi SQLMa ,
I was trying a similar code, using a hierarchy expression instead of a member expression for the CurrentMember functionality . Here is an Adventure Works example :
With member MEASURES.ActiveLicences as 
sum ( {[Delivery Date].[Fiscal].CurrentMember: null}
, [Measures].[Internet Sales Amount]) 
select {MEASURES.ActiveLicences,[Measures].[Internet Sales Amount]} on columns
, [Delivery Date].[Fiscal].[Month].members on rows 
from [Adventure Works]
Hope it helps :)
Regards, David .

Similar Messages

  • Last 6 months of data from current date

    Hi Experts,
    I have a requirement in WebI to display last 6 months of data based on current date.Actually I have a column called "Employee Contract Start date" in my report.Suppose the end user executes the report today,then he should be able to see the Employee's data whose contract started today and in the last 6months from current date.
    Also I have dimension object name "Employee Contract Start Date".
    Please be noted that I am getting the data from Bex Query and I am working on BO 4.1 version.
    I have Objects "Calender day" , "Cal.year/Month" , "Calender month" , "Employee Contract Start Date" in the BEx Query.
    Could anyone please propose me, what are the ways to meet this requirement?

    Hi Cris,
    We can get the 6 Months date in webi.
    Check the below blog , will help you.
    http://scn.sap.com/community/businessobjects-web-intelligence/blog/2014/01/21/time-variablesdimensions
    Regards,
    Javed

  • Creation of a Query to show the values for the current month and the last 12 months data.

    Dear All,
    Good day!
    I have to create a Query with the below requirement.
    I have to create a Query to show the values for the current month and the last 12 months data.
    Can you please guide me how to achieve this ??
    thank you,
    Regards,
    Hema

    Hema
    explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
    you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
    for some more hints..
    http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
    http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
    http://scn.sap.com/thread/3217381
    search on SDN you will get many other ways..
    Thanks,
    Bhupesh

  • Extract data on report between last 30 days from current date.

    Hi Experts,
    Ealrier i had provided user promt to select the date range, now i need to schedule the report for this i have to set the date between last 30 days from current date.
    How can i add this in formaula on record selection.
    before:
    {pm_process.pm_creation_date} in {@Start Date to UTC} to {@End Date to UTC}
    I tried:
    {pm_process.pm_creation_date} in CurrentDate() - 30 to CurrentDate()
    But this is diplaying me only data of 30th date from current date.
    Please advice.

    Hi Brian,
    Thank you!
    1. I have not created any function for {pm_process.pm_creation_date} in [CurrentDate() - 30 to CurrentDate()] i am just adding this on Record Selection and its not helping.
    2. {pm_process.pm_creation_date} in Last30Days; this is throwing below error.
    please advice what to be done?

  • How to get name of the month from current date.

    Hi,
       How to get the name of the month from current date.
    Thanks,
    Senthil

    Sethil,
    Use your date(let us say Date1) instead of sy-datum.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
    TABLES
    MONTH_NAMES = itab_month
    EXCEPTIONS
    MONTH_NAMES_NOT_FOUND = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE itab_month
    WITH KEY MNR = date1+4(2).
    itab_month-LTX will contain the value you are looking for
    Good luck
    Raghava

  • Get last august month from current date

    Hi,
    I need to get last august month from current date.
    e.g if current date is 1-OCT-2013 need to get last August date i.e.1-AUG-2013
    e.g. if current date is 1-MAY-2013 need to get last August date i.e.1-AUG-2012

    Something like this?
    SQL> WITH table_x AS(
      2     SELECT SYSDATE dt from dual UNION ALL
      3     SELECT TO_DATE('20-05-2013','dd-mm-yyyy') from dual
      4  )
      5  --
      6  ---
      7  --
      8  SELECT  dt,
      9    CASE
    10      WHEN (dt >= Add_Months(TRUNC(dt,'YEAR'),7)) THEN
    11          Add_Months(TRUNC(dt,'YEAR'),7)
    12      WHEN (dt < Add_Months(TRUNC(dt,'YEAR'),7)) THEN
    13          Add_Months(TRUNC(dt,'YEAR'),7) - 365
    14    END cs
    15  FROM table_x;
    DT        CS
    24-OCT-13 01-AUG-13
    20-MAY-13 01-AUG-12

  • 2 month old date from current date in red color only

    Hi all,
    How can I Highlight 2 month old date from current date in red color only at report level with using Alertr.
    Example:-
    Date
    3/27/2014
    4/3/2014
    3/5/2014
    4/1/2014
    3/31/2014
    5/24/2013
    2/10/2014
    4/11/2014
    12/11/2013
    9/25/2013
    1/30/2014
    2/18/2014
    2/24/2014
    1/6/2014
    3/3/2014
    Thanks
    Sam

    Hello Sam,
    are you using Universe for your report..if Yes..pls try below option.
    Create two objects in the universe
    Object1 syntax: current date() (Note:this object you can create at webi level)
    Object 2 syntax:addmonths(sysdate;-2)
    Now create a alert in webi report by using below conditions
    Day is less than Object1
    and
    Day is greater than Object2
    Please try this and let me know if any issues.
    Regards,
    Naveen D

  • Subtracting months from current date

    how to subtract months from current date in mysql

    You are in an Oracle forum, so the Oracle answer is: use add_months(sysdate,-2) to subtract two months from the current date.
    Regards,
    Rob.

  • Minus age from current date

    Hi experts,
    I have an Age field coming from sender system.
    I need to minus the age from current date and provide the output in form of date towards the target system.
    PLS help me out..

    Hi
    have a look at these
    (How do I calculate the difference between two dates?)
    http://joda-time.sourceforge.net/faq.html
    Calculating the Difference Between Two Datetime Stamps
    http://www.xmission.com/~goodhill/dates/deltaDates.html
    Get difference in days
    http://javaalmanac.com/egs/java.util/CompDates.html
    Thanks
    Gaurav

  • I have a 1st Gen, MacBook Pro from 2006. For the last few years I've had to us my power adaptor as my battery no longer works. Now my power adaptor looks like it's coming to an end. Even though it's securely fitted, it often switches off.

    I have a 1st Gen, MacBook Pro from 2006. For the last few years I've had to us my power adaptor as my battery no longer works, and shuts down after 30 seconds it. Now my power adaptor looks like it's coming to an end. Even though it's securely fitted, it often switches off.
    I am planning on buying a new MacBook Pro later this year, but for the meantime I'm not sure if I should buy a new power adaptor, or if this is a problem with my MacBook Pro. Also does anyone know where I can buy a battery in the UK for 1st Gen MacBook Pro.

    OWC has batteries for 1,1 generation MacBook Pros and they ship internationally - http://eshop.macsales.com/.
    Your best bet for a power adapter is to get one from Apple. Third-party adapters just don't seem to be reliable (or safe). You can also buy a replacement battery directly from Apple, of course, but they're a bit more expensive.
    Good luck,
    Clinton

  • I exported an archive of iCal from a computer running the last OS X. On a new computer running OS X (10.7.4), I tried to import the .icbu file and got a message "The calendar failed to restore". How do I fix this/get my calendar?

    I exported an archive of iCal from a computer running the last OS X. On a new computer running OS X (10.7.4), I tried to import the .icbu file and got a message "The calendar failed to restore". How do I fix this/get my calendar?

    I exported an archive of iCal from a computer running the last OS X. On a new computer running OS X (10.7.4), I tried to import the .icbu file and got a message "The calendar failed to restore". How do I fix this/get my calendar?

  • I am Greek. I downloaded a film from ipad but for the last days it has not been downloaded and the status is "waiting".the charge has been made to my credit card. Does any body knows?

    I am Greek. I purchased a film from ipad but for the last days it has not been downloaded and the status is "waiting".the charge has been made to my credit card. Does any body knows?

    something other is dowloading somewhere on ipad

  • Hello,I am a phone dealer in Nigeria. please how can i track a brand new iphone 5 64gb and 16gb that was stolen from my shop with the last 4 digit IMEI numbers?

    Hello,I am a phone dealer in Nigeria. please how can i track a brand new iphone 5 64gb and 16gb that was stolen from my shop with the last 4 digit IMEI numbers?

    What To Do If Your iDevice or Computer Is Lost Or Stolen
    If your Mac, iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should do in advance - before you lose it or it's stolen - and some things to do after the fact. Here are some suggestions:
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T, Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. Lost or Stolen iPhone? Here’s What to do
      6. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      7. Find My iPhone
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on MobileMe
      3. OS X Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)

  • Find whether current page is the last page

    Post Author: guyi
    CA Forum: JAVA
                                                      hi,I am using JRC to open and view a report in my JSP.I would like to create my own toolbar in the page, for that I set the toolbar display in the CrystalReportViewer to false as follow:viewer.setDisplayToolbar(false);I
    need to recognize the current page number and whether current page is
    the last one, I found that CrystalReportPartsViewer has the right
    method isLastPage(), unfortunately it does not work - this method
    always return false.(Note that I am using the viewer.getHtmlContent() method and not viewer.processHttpRequest()) Any idea?Thanks in advanceGuy

    Post Author: Ted Ueda
    CA Forum: JAVA
    Part of the equation is supplied via method:
        doc.getReportSource().getLastPageNumber(new com.crystaldecisions.sdk.occa.report.reportsource.RequestContext());
    where doc is the ReportClientDocument class instance for the report.
    Sincerely,
    Ted Ueda

  • I am trying to stream video from iTunes store for the last 2 days and all I get is the message "iTunes store is unavailable. Try again later." I have tried turning it off, restoring it, signing in and out again.  Netflix works though.

    I am trying to stream video from iTunes store for the last 2 days and all I get is the message "iTunes store is unavailable. Try again later." I have tried turning it off, unplugging all cords, restarting it, reseting it, restoring it, and signing in and out again.  Netflix works, but iTunes seems to be bugging out.  If anyone could help, it would be much appreciated.  Thanks.

    melaniefrommadisonville wrote:
    I want to try to un-install iTunes then re-intstall but am a new mac user and don't know how to do this.
    click here and follow the instructions.

Maybe you are looking for

  • Interactive report Column headers

    Hi , I am using apex 4.2, My IR report contains more than 500 rows , so when I scroll down , I am unable to see the column headers. How to make column headers to be visible even when I scroll down. Please guide me to achieve that . Thank you, Nihar N

  • Link between GTM and FSCM (sales or purchase order hedging)

    Hi all, I am trying for a few days to have SAP GTM working (I am in an IDES ECC6 system, and as far as I know in EhP4 version). The main goal in fact is to test the currency hedging, and therefore to the link GTM and FSCM, either single-sided purchas

  • Firefox 3.6.13 hangs freezes repeatedly with multiple tabs open

    I am running FF v3.6.13 on a Vista laptop. I typically have over 60 tabs open during a session (pretty much the same ones each time). In the last two weeks, FF has started freezing repeatedly while these tabs are open, whether I am using it or it is

  • Albums and events question

    Hi when I drag folders containing photos into Iphoto it creates an event. What I currently do is after the event is created, I select an event, I hit the + sign in the bottom left and create an album. I like having my albums on the left side for quic

  • Service Entry Sheet from Service Confirmation

    Hello Gurus, We have requirement to create Service Entry Sheets in SAP ECC corresponding to Service Confirmation in SAP CRM. Any ideas on how this can be achieved utilizing standard SAP CRM Middleware functionalities? Also once a Service Entry Sheet