Day and Month date format - Calculating a measure only for the last day date format

Good evening all,
I'm really struggling with a MDX query and so would greatly appreciate your help ..
Here is a simplified representation of my data:
Id
Tenor
VarX
1
10-Jan-14
10
2
10-Jan-14
10
3
10-Jan-14
10
4
11-Jan-14
10
5
12-Jan-14
10
6
13-Jan-14
10
7
Feb-14
10
8
Mar-14
10
9
Apr-14
10
And here is the MDX result I’m trying to get:
Tenor
VarX
VarY
10-Jan-14
30
0
11-Jan-14
10
0
12-Jan-14
10
0
13-Jan-14
10
90
Feb-14
10
0
Mar-14
10
0
Apr-14
10
0
Where: if tenor is the last tenor in day format (i.e. dd-mmm-yy) VarY = total sum of VarX else VarY = 0
Here is a first try below which hopefully will help you understand my problem.
MEMBER [Measures].[VarY] AS
IIF (
ISEMPTY([Measures].[VarX])
OR vbamdx!Len([Tenor].CURRENTMEMBER.Name) <= 6 
OR TAIL(
FILTER(
{[Tenor].[ALL].CHILDREN},
NOT (ISEMPTY([Measures].[VarX])) AND vbamdx!Len([Tenor].CURRENTMEMBER.Name) > 6 
).ITEM(0).Name <> [Tenor].CURRENTMEMBER.Name,
NULL,
SUM ( [Tenor Group].[Tenor Group].[all], [Measures].[Delta] ) )
Please let me know if you have any ideas and/or advice.
Thanks in advance! Kevin

Hey Aleksandr
Tenor is a string. The tenor table is used by other reports too and contains tenors in day, month, etc format (e.g. 01-Jan-14, 02-Jan-14, 03-Jan-14, ..., Jan-14, Feb-14, ...).
This is why I was trying to differentiate the 2 "groups" of tenor using length.
Something like:
MEMBER [MEASURES].[MOUT] AS 
iif(
isempty([Measures].[VarX]),
null,
iif(
(Len([Tenor].CURRENTMEMBER.NEXTMEMBER.Name) =  
 Len([Tenor].CURRENTMEMBER.Name)
null,
SUM ( [Tenor].[all], [Measures].[VarX])))

Similar Messages

  • How do I set a recurring event for the last day of the month on iphone 4s calendar?

    I want to set a recurring event for the last day of every month - regardless of the date/number of days in the month. I'd prefer not to have to use an app to do this.

    Hi,
    You can do this using the custom repeat in iCal. You'll need two events to cover the second and fourth Mondays.
    Create the event on the second Monday of the month. In Repeat select Custom... > Frequency: Monthly > On the: second Monday.
    Do the same for the Fourth Monday.
    Best wishes
    John M

  • How to get the date for the last day of a week?

    Is there a easy way to get the date for the last day of week?
    eg a week starts on monday and end on sunday
    January 11, 2005 is the start date for the week
    January 17, 2005 is the end date for the week
    or
    say
    February 26, 2003 is the start date for the week
    March 5, 2003 is the end date for the week
    I just need a simple way of figuring that out....
    I figured out how to get the start date for the week but just can't get the latter..
    formatting of the date is not of a concern.. that I know how to do
    thanks in advance

    How about something like the following?
         Calendar someDay = new GregorianCalendar(2005,0,11);//2005 Jan, 11
         //Note above that January is 0, not 1, as counting starts from 0.
          someDay.add(Calendar.DAY_OF_MONTH,6); //add 6 days
         java.util.Date  lastDayOfWeek = someDay.getTime();
         //If someDay was the start of a week, lastDayOfWeek should now be
         //the last day of that week.
         System.out.println(lastDayOfWeek.toString() );

  • How do I set a reminder for the last day of every month

    Have I missed something? But how do you set a reminder for the last day of every month to recurr indefinatley in iOS6? Sorry if this is really simple but I just can't seem to work it out. Any help gratefully received.

    Hey Mattye88 not sure if you have seen but actully you can do this, but for some reason you have to use Siri.  If you bring up Siri and say "set a reminder ever 4 weeks from next wednesday to check the gas meter" it will set one and it will work just fine, I have reminders to water a Bonsai every three days and it works fine it just shows as custom repeat on the user interface.  Alas it seems you can not use Siri to set one for the end of the month though which is why I am in this threed.  Still hope it helps you to know how to sort this problem atleast.

  • 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

  • My macbook has Itunes and I am trying to download some songs that I bought on my Ipad onto the macbook. It has worked in the past, but one song has been downloading for the last day. No more will download it seems stuck downloading.

    My macbook has Itunes and I am trying to download some songs that I bought on my Ipad onto the macbook. It has worked in the past, but one song has been downloading for the last day. No more will download it seems stuck downloading. I don't need the song. But I want the others to download.

    Hi there,
    You may find the information in the articles below helpful.
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/ht2519
    iTunes: How to resume interrupted iTunes Store downloads
    http://support.apple.com/kb/ht1725
    -Griff W. 

  • I need help in Downloading Adobe Elements for my Mac & Adobe Acrobat for my laptop...I have been battling for the last day.

    I need help in Downloading Adobe Elements for my Mac & Adobe Acrobat for my laptop...I have been battling for the last day.

    ~graffiti wrote:
    PjonesCET wrote:
    I know if you attempt to download and exe file to Mac from a Mac Partition you'll get something like. Cannot not understand file format octet-stream. This means it does not recognize MS execute files.
    Not necesarily. I've done it a few times.
    PjonesCET wrote:
    I'm not sure you can download a PC copy of Acrobat 9 unless you operating from bootcamp or other such application and running the PC partition.
    Yes. You can.
    I've learned something. New. This must be recently changed. That last time I clicked on a Link I though was a dmg file and turned out it was and exe file my Macs wouldn't allow me to do so. But haven't tried recently everytime and exe file comes up I cancel. I gues I am used to the time everytime a Virus or some other nasty was downloaded it was packaged in and exe file and Macs owuldn't allow it. I suppose with the INtel guts now they can no longer refuse to download.

  • I just went from an iPhone 4 to a 5. I stored my contacts on icloud with my 4, then on my 5 I turned contacts off and on to merge them but it only added the last 10 or so contacts I created. What gives?

    I just went from an iPhone 4 to a 5. I stored my contacts on icloud with my 4, then on my 5 I turned contacts off and on to merge them but it only added the last 10 or so contacts I created. What gives?

    What exactly do you mean by:
    "I turned contacts off and on"

  • Customer exit variable for date range for the last day

    Hi,
    If user enters date ranges in variable
    suppose user enters 9/1/2010 to 9/15/2010 and we have to calculate currency conversion based on last day i..e 9/15/2010 . 08
    2)User input is date range 08/01/2010 to 08/30/2010
    I need from the customer exit 08/30/2010 (on last day) to calculate currency conversion.
    Can anyone help me with ABAP code to achieve this customer exit?And please tell me how to proceed step by step
    Sridhar

    create a variable to enter date range (ZDATE1)
    create a key date variable(ZDATE2) with processing type customer exit, should not be ready for input.
    In the exit ZXRSRU01 write below code.
    DATA: l_s_range TYPE rsr_s_rangesid,
          loc_var_range LIKE rrrangeexit.
    WHEN 'ZDATE2'.
        IF i_step = 2.
           read table i_t_var_range INTO loc_var_range
                    with key vnam = 'ZDATE1'.
            CLEAR l_s_range.
            l_s_range-low = loc_var_range-high.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
        ENDIF.

  • I just installed Creative Cloud and I have had a blue rotating circle for the last 40 minutes in the screen. Have tried force quit and restarting and problem persists.

    I just downloaded Creative Cloud for Photographers and nothing seems to be starting. I cannot download photoshop or lightroom because there is a blue circle in the creative cloud window

    I have similar problems. I install cc-app, start it and get an empty cc screen with a blue timer in the middle of the screen that gives me the impression it tries to connect to something.
    I have been browsing this forum for days and have tried 'everything' I could find:
    - turned off firewall
    - connected directly to the internet without a router
    - opened ports
    - uninstalled cc multiple times
    - uninstalled all Adobe software (used to run CS6)
    - used cc-cleaner
    - manually deleted all adobe related directories
    - removed the OOBE directory multiple times
    - gave cc administrator permissions
    I'm using windows 7.
    Another thing I noticed: when cc is running in the background and I play a computer game, cc takes me back to windows. This only stops when I turn off cc.

  • Firefox takes time loading and keeps stopping every few seconds, but only in the last week

    I have had updates for Windows and wonder if there is a clash between the two. I also seem to be getting more errors thn I ever had. I have tried uninstalling FF and reinstalling it and the results are still the same. It is damm annoying to have had such a great website that just seems to have malfunctioned overnight 25 April seems to have been the date, anything changed at your end

    hey try a smc reset
    EDIT (smc reset
    Shut down the computer.
    Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
    Release all the keys and the power button at the same time.
    Press the power button to turn on the computer. 
    Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC.)
    if that doesnt help look at replacing the batteries in your magic mouse and try it then
    if the issue still presists take it into a apple store and they can test it there to see whats up

  • Define event to repeat on the last day of each month?

    (I've searched the forum and can't find this question addressed)
    I want to create a repeating event for the last day of each month. Is this possible?

    Unfortunately Apple does not have an option available that allows you to add an event repeating on the last day of the month. An "OK" way around this would be to repeat on the 1st of every month and send a reminder a day earlier. I know this is less then perfect but the only option currently available. If you happen to find a 3rd party program that allows such integration please don't hesitate to mention it here as I have been looking for this sort of option for quite some time now!

  • How to get the last day according to fiscal period input in selection scree

    Hello expert
    how to get the last day of fiscal period input.
    the fiscal period inculdes 1-16
    when fiscal period is greater than 12, only calculate the last day of 12nd month
    your solution will be apprecaited, FM existing?
    thank you
    Kevin

    Hi,
    when you give a particular date in any month
    the following fm will give you the last date of that month
    here you can give
    R_FDATE-HIGH  as 01 and month as the period you wnat and year for current year
    concatenates '01'  month year  into r_fdate-high separated by '.'.
    then it will give g_ltdt for that month and year which wil be the last date of that month
        CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
          EXPORTING
            DAY_IN            = R_FDATE-HIGH
          IMPORTING
            LAST_DAY_OF_MONTH = G_LTDT
          EXCEPTIONS
            DAY_IN_NO_DATE    = 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.
    thanks & regards,
    Venkatesh

  • Updated to Adobe Muse 2014 this morning and have worked in it for the last 8 hours. Now when I try to publish the updated site to Business Catalyst for my client to preview it crashes everytime. I have tried just publishing altered files only, then tried

    Updated to Adobe Muse 2014 this morning and have worked in it for the last 8 hours. Now when I try to publish the updated site to Business Catalyst for my client to preview it crashes everytime. I have tried just publishing altered files only, then tried the whole site again, and then tried publishing as a new site altogether. Thought I would then try to export as HTML in the hope of uploading the files via an FTP client and Muse crashes and locks up again. I am extremely stressed about this as I am in the last few days of of website I have been working on now with no issues since December. We are due to go live and my client needs to see it. I am desperate for an answer. It is not looking good. I am on an Apple Mac and have not had any isses publishing it for the last 6 months. Not very happy to say the least. Need desperate help.

    Hi Zak, I got onto Adobe Customer Care Live Chat this morning and gave them the error message. After some trouble shooting with them it appears the older archived file of the site still publishes. I have now reverted back to the old file and copied and pasted out of the new file and from some ideas given to me by support I am now able to publish to Business Catalyst. It seems there was something corrupt within the new pages added yesterday. I have no idea if this would have still happened if I hadn't updated but I am glad it wasn't a Muse specific problem. I am loving using Muse and the support from Adobe has been excellent. Thanks everyone. By the way I do love the new version and apart from this hick up that lost me a few hours, aged me some more and gave me grey hair I really love Muse. Thanks again.

  • The calendar sync is recently not working correctly, not display "All events" but it only displays the last six months for my individual entries. My repeating entires do go back further, though. How do I fix?

    I have an iPad 5.1.1. The calendar sync has started to not work correctly. I have it checked "All events," but it only displays the last two months for my individual entries. My repeating entires do go back further, though. How do I fix?

    HI Jason269. Thanks for your reply, however I wrote that I already have "All events" checked. If All Events is checked and it doesn't diaplay all events, how do I fix? It seems this is a common issue, as I have read many others on here state the same problem.
    I believe my problem occurred when I synced my iMac calendar to my iPad calendar using yahoo. Yesterday, I unsynced them on my iMac controls. When I checked my iPad calendar, all of my old entries reappeared - but only for five seconds and disappeared again. So, the data is saved and still there but cannot be displayed, even when I have All events checked. In fact, it only shows my individual entries for the last two months, but does show all my recurring entries. If I switched to last six months, I will see everything for the last six months. If I switch back to all events, it is only for the last two months.
    As I mentioned, others on here have expressed exactly the same issue, including the two month example and having used yahoo.
    For legal purposes, I need to be able to use the information from my indidual calendar entries in an upcoming court case. So I really need to fix this ASAP!

Maybe you are looking for