CREATE RANGE SET using Now()

Hello,
I need to create set for last 10 days from last sunday.
I am able to create single values for last sunday and for last sunday minus 10 days
WITH SET [LastSunday] AS
StrToMember('[Calendar date].[Year - Quarter - Month - Date].[Date].&[' + Format(DateAdd("d",-10,DateAdd("d",-DatePart("w",Now()),Now())), "yyyy-MM-dd") + 'T00:00:00]')
SET [Last sunday minus 10 days] AS StrToMember('[Calendar date].[Year - Quarter - Month - Date].[Date].&[' + Format(DateAdd("d",-DatePart("w",Now()),Now()), "yyyy-MM-dd") + 'T00:00:00]')
It works fine, but how can I create SET with CREATE SET clause for range [LastSunday]:[Last sunday minus 10 days]
I have tried
CREATE SET [LastSunday] AS
StrToMember('[Calendar date].[Year - Quarter - Month - Date].[Date].&[' + Format(DateAdd("d",-10,DateAdd("d",-DatePart("w",Now()),Now())), "yyyy-MM-dd") + 'T00:00:00]:
[Calendar date].[Year - Quarter - Month - Date].[Date].&[' + Format(DateAdd("d",-DatePart("w",Now()),Now()), "yyyy-MM-dd") + 'T00:00:00]')
But it did not work.
Thanks

Hi Volyn,
Please try the query below.
CREATE SET [LastSunday] AS
StrToMember('[Calendar date].[Year - Quarter - Month - Date].[Date].&[' + Format(DateAdd("d",-10,DateAdd("d",-DatePart("w",Now()),Now())), "yyyy-MM-dd") + 'T00:00:00]:
[Calendar date].[Year - Quarter - Month - Date].[Date].&[' + Format(DateAdd("d",-DatePart("w",Now()),Now()), "yyyy-MM-dd") + 'T00:00:00]')
Here is a sample query on Adventure Works for your reference.
Reference:
MDX Named Set Rolling Date Range
Creating a Rolling Date Range Named set in MDX
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • How to Create BC SET using Transport Request

    Hi,
    How to Create BC SET using Transport Request.if any one knows help me

    Hi Gowri,
    The below given description might help u out ..
    You want to create a BC Set from a transport request. A transport request containing Customizing data must already exist.
    This Customizing request is a change request with which you can copy and transport the changed system settings.
    The BC Set is based on the data in the Customizing request. You can copy all the data records in the Customizing request into the BC Set, or select a subset.
    You can subsequently edit BC Sets created from transport requests.
    Procedure
    Enter the Customizing request number and Continue.
    -> You can search for requests with the F4 help. The request type is Workbench/Customizing requests. The request status is changeable or released.
    -> You get an overview of the transport objects in the transport request. To put a transport object in the BC Set, flag the row Copy.
    ->The Status column tells you the BC Set-compatibility of the transport object. It can have the following values:
    ·        green traffic light: The transport object can be put in the BC Set.
    ·        yellow traffic light: BC Set creation or activation problems are possible. Check whether all data records have been put in the BC Set, after you create it.
    ·        red traffic light: Table entries exist, but they cannot be interpreted. They cannot be put in the BC Set.
    ·        Cancel: The transport object cannot be interpreted or put in the BC Set.
    You can get detail information about the object at the bottom of the screen, by double-clicking on a row. For detailed information about messages, choose the icon in the Documentation column.
    The Activity column indicates the associated IMG activity. If no unique assignment is possible, the field is empty. To assign an activity or change an existing assignment, choose the Change Activity icon. Position the cursor on the IMG activity to which you want to assign the object, and choose Select.
    When you have made your choice, choose the Save Data from Transport Request icon.
    Make the necessary entries in the following dialog box Create Object Directory Entry. Choose Save.
    To create the BC Set with the selected rows, choose Save.  
    When you read the transport request, the data records are initially only read in the logon language. When you save the BC Set, all languages in the system are also put in the BC Set.
    You can edit the BC Set manually at any time. Proceed as described in Change BC Set.
    Reward if helpful.
    Thankyou,
    Regards.

  • Create document set using ECMA Script

    Hi,
    I want to create a document set in SharePoint 2010 document library where i have already included document set content type.
    Is there any way to create a document set using ECMA Script?? If yes, then please provide the sample code for this...
    Thanks.
    -Prashant

    Hi Prashant,
    Although this post is aimed at SP 2013 and the App model, it should give you the object model references you need to complete your goal:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    In particular the following function should be of use:
    function CreateDocumentSet() {
    var ctx = new SP.ClientContext("http://yourSharePointSite");
    var parentFolder;
    var newDocSetName = $('#txtGetDocumentSetName').val();
    var docSetContentTypeID = "0x0120D520";
    var web = ctx.get_web();
    var list = web.get_lists().getByTitle('DocSetLibrary');
    ctx.load(list);
    parentFolder = list.get_rootFolder();
    ctx.load(parentFolder);
    var docsetContentType = web.get_contentTypes().getById(docSetContentTypeID);
    ctx.load(docsetContentType);
    ctx.executeQueryAsync(function () {
    var isCreated = SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
    ctx.executeQueryAsync(SuccessHandler('Document Set creation successful'), FailureHandler("Document Set creation failed"));
    }, FailureHandler("Folder loading failed"));
    ctx.add_requestSucceeded(function () {
    $('#txtGetDocumentSetName').val('');
    alert('Request Succeeded');
    ctx.add_requestFailed(function (sender, args) {
    alert('Request failed: ' + args.get_message());
    // Failure Message Handler
    function FailureHandler(message) {
    return function (sender, args) {
    alert(message + ": " + args.get_message());
    // Success Message Handler
    function SuccessHandler(message) {
    return function () {
    alert(message);
    Keith Tuomi | Twitter: @itgroove_keith | Blog:
    http://yalla.itgroove.net
    Please click "Propose As Answer" if a post solves the problem or "Vote As Helpful" if a post has been useful to you.

  • Problem in creating a new set using GS01

    Dear all,
    I am trying to create a set using Tcode - GSO1.
    But wehn try to create a SET with Basic Set it is asking for a ref table
    can you please help with some links about creating SETS.
    I want to create aset where we can maintian a list of Specific userid.
    Regards,
    Gaurav Sood

    Issue resolved

  • Create document set by workflow based on external list

    Hello,
    I'm wondering if the following is possible:
    I have a external list with all my projects.
    Next to that i have an document library where i place all the documents about the projects in document sets. Is it possible to automatically create the document sets based on the external list?
    So when a new record is created in the database (External list) it automatically creates a document set. (The document sets have an external data column which refers to the projects external data)
    I was thinking of an workflow, but i don't know how to accomplish this. I'm just a beginner with SharePoint.
    Kind regards,
    Robbert-Jan

    Hi Robbert ,
    According to your description, my understanding is that you want to create a document set for an external list in SharePoint 2013.
    For achieving your demand, you can refer to the article:
    http://msdn.microsoft.com/en-us/library/ff394479(v=office.14).aspx
    http://blogs.msdn.com/b/chandru/archive/2013/08/10/sp2013-creating-document-set-using-workflow.aspx
    One thing to notice is you cannot associate workflow with External List because workflow engine cannot run on back end system.
    Reference:
    http://siddiq-sharepoint2010.blogspot.in/2011/12/bussniess-connectivity-services.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to add a file in Document Set using ECMA script?

    Hi,
    I want to upload a particular file into Document set using ECMA script.
    I can do it easily through C# but unable to achieve the same using ECMA Script.
    Any pointers or piece of code will be helpful.
    Thanx in advance :)
    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"

    The following blog post provides a way to create a document set using ECMA:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    The following blog post provides a way to upload files into a document set using CSOM:
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    See if you can follow the logic in the CSOM example to apply it to ECMA. Let me know if you have specific problems with it.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Create document number range 22 using internal number assignment

    Hi friends,
    now i am working upgradation project from 4.7 to 6.0. sandbox i created one Asset, After that i posed amount to that asset by using f-90.now i run depreceation in ABAF T code the bellow issue is comming
    Create document number range 22 using internal number assignment
         Message no. AA776
    Diagnosis
         Processing terminated because the document number range 22 for year 2011
         was set up with external number assignment.
    System Response
         For periodic posting of depreciation, you have to create a document
         number range with internal number assignment, since the document numbers
         are assigned from Financial Accounting.
    Procedure
         Change the number assignment for the number range 22 from external to
         internal in Customizing for Asset Accounting. See SAP Note 890976 for
         more information.
    But no ranges for that particular year having, if any changing that one it s not come edit or deleating
    ple any one help me
    Regards
    Gangadhar reddy

    Hi Gangadhar,
    after 4.6C the Internal Number Range was changed into external Number Range due to technical requirements.                                                                               
    As the error messages due to posting manual into the affected  number ranges could not be hindered in this case with ERP2005 the desicion was made to rechange to internal number range. Note 890976 describe what to do here.                             
    regards Bernhard

  • Setting user specific contract data while creating sales order using BAPI

    Hi all,
    I am creating sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2.
    Now my problem is that there is no structure for contract data (i.e. VEDA), system automatically set contract data using customization values.
    I am doing some validations on cotract data in MV45AFZZ which fails, because these validations are performed on standard values, user specific values r not set.
    How to handle this issue, your small clue may help a lot.
    Regards,
    S@meer

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • A few months ago, I purchased a new iMac. I recently created a movie using iMovie. Then I found out that iDVD is not included. So I have the problem that I want to burn a movie that I can play on my DVD player and watch on a television. i rang Applecare a

    A few months ago, I purchased a new iMac. I recently created a movie using iMovie. Then I found out that iDVD is not included. So I have the problem that I want to burn a movie that I can play on my DVD player and watch on a television. I rang Applecare and was told that I need a program called BURN.
    Is this correct? I can export the movie from iMovie in a m4v format, but I think I need to convert this to iso format before I can burn the disc.
    I know there are programs like TOAST that will do this, but it is expensive.
    I would be very grateful for any assistance.

    Burn will not do what you want, and there is no real substutute for iDVD.
    Why is there no iDVD on my new Mac?
    Apple insists that the entire world has access to fast broadband (and are prepared to pay for the considerable bandwidth usage) and wants to distribute home movies to friends and relatives via download (iCloud, YouTube, Facebook, whatever) rather than mailing them a DVD. The fact that in reality not all users do, has so far had no effect on this policy. If you scream and shout loudly enough down the phone Apple may send you a free copy of iDVD. Stating that they would return their brand new Mac unless they received a copy of iDVD worked for some, but that is now said to have been withdrawn by Apple.
    Also, you can complain bitterly via Apple’s Feedback link, perhaps suggesting that Apple could have provided a choice between burning DVDs and distributing home movies by other means. You may feel that Apple should not dictate how you destribute family videos or photos to distant relatives and friends, and should not assume that every user is prepared to pay for the excessive bandwidth usage charged by ISPs for huge downloads from the App Store:
    http://www.apple.com/feedback/
    Whilst Macs with a Superdrive continue to be able to burn video DVDs, the software for so doing, iDVD, is no longer included in the iLife bundle that came with OS 10.7 Lion (which also omitted iWeb) or that comes with OS 10.8 Mountain Lion. And it is no longer included in the iLife 11 from the online Apple Store: http://www.apple.com/ilife/. Your only solution is to look on Amazon or eBay and try to get an older version that includes iDVD 7, i.e. iLife version 9 onwards. You should also do this if you plan to buy a new Mac anytime soon, as stocks of iLife that include iDVD will not be available for ever.
    However, the vastly more expensive FCPX can burn a DVD without iDVD or DVD Studio Pro involvement, but lack the themes etc of iDVD. Also, of course, there is Roxio Toast, which is the best software for burning anything but again does not offer the flexibility of iDVD.
    And if you think Microsoft are any better, their new Windows 8 operating system will not play DVDs, or burn them, unless customers buy an extra upgrade, the company has announced:  http://www.gizmag.com/windows-8-no-dvd-playback/22443/
    In other words, computer manufacturers have declared optical media as dead, long before consumers are ready to stop using them, which is fine as long as they offered us a choice, but they won’t even do that. Flexibility and intuitive use of a computer seems to be a thing of the past.

  • Using Adobe Premier Elements to create a video using the photos and it is make the photos blurry. Is there a setting to correct this?

    as the subject states, i am suing Premier Elements pro to create a video using photos. The photos are clear then when you play the video they become blurry. I would guess there would be a way to correct this but not having much success. any helps would be great.

    Iltowman
    Thanks for the follow up. Right now I see details that do need addressing. For one, you are importing 3:2 photos into a project set for 16:9.
    You still have not told us what version of Premiere Elements that you are using and on what computer operating system it is running. For now I will assume, Premiere Elements 13/13.1 on Windows 7, 8, or 8.1 64 bit. NTSC setup.
    Please try the following as a mini test run (just a few of your photos) to determine if the Timeline photos present better in the Edit area and in an export.
    1. Open Premiere Elements 13/13.1 to the Expert workspace and go to File Menu/New/Project and Change Settings.
    2. In Change Settings, change the settings to
    NTSC
    DSLR
    1080p
    DSLR [email protected]
    OK out of there.
    3. In the New Project Dialog that now opens, rename the project and make sure that you have a check mark next to Force Selected Project Setting on This Project. OK out of there.
    4. Back in the Export workspace, import your photos using Premiere Elements' Add Media/Files and Folders/Projects Assets from where you drag the photos to the Timeline. There will be an orange line over the Timeline content. Press the Enter key of the computer main keyboard. or the Render button above the Timeline to do Timeline rendering which will result in the best possible preview in the Edit area monitor.
    Also, right click the Edit area monitor, select Playback Quality, and then determine if the "Highest" gives better results than "Automatic".
    If all looks good, then let us look at the quality of a AVCHD.mp4 export of that Timeline....
    Publish+Share
    Computer
    AVCHD
    with Presets = MP4 - H.264 1920 x 1080p30.
    Is the quality of the photos in this mini test run better, the same, or worse?
    About your photos (3872 x 2592 3:2)...video is 4:3 or 16:9. So to avoid black borders, you could consider
    a. cropping the originals from 3:2 to 16:9 before import
    or
    b. importing them as is and doing any needed scaling in the Edit area monitor
    But, right now the focus is on image clarity rather than black borders.
    Please review and consider.
    Thank you.
    ATR

  • Create document number range 03 using internal number assignment in AFAB

    Hi Experts,
    Where i have to create number range to Depreciation Posting ? Please mentain Transaction code .
    I had check T Code:AS08 (No Tick is assign)  & FBN1 (Intrenal Tick is assign)
    I am doing T Code AFAB
    Folowing error coming
    Create document number range 03 using internal number assignment
    Message no. AA776
    Diagnosis
    Processing terminated because the document number range 03 for year 2011 was set up with external number assignment.
    System Response
    For periodic posting of depreciation, you have to create a document number range with internal number assignment, since the document numbers are assigned from Financial Accounting.
    Procedure
    Change the number assignment for the number range 03 from external to internal in Customizing for Asset Accounting. See SAP Note 890976 for more information.
    Waiting for reply
    Regards,
    Girish

    locked.  please read the error message and search the IMG (very easy).

  • I have 2 apple id's with different apps and data saved under each.  It's very annoying so now I want to create a new id with my primary email address I use now.  If I do that is there any way to transfer all my saved apps and app data like game saves etc?

    I have 2 apple id's with different apps and data saved under each.  It's very annoying so now I want to create a new id with my primary email address I use now.  If I do that is there any way to transfer all my saved apps and app data like game saves etc so I don't lose all of that information and can easily switch to a singular apple id?

    Apple does not transfer content bought with one Apple ID to another Apple ID. Apple will not merge two Apple IDs.
    If most of your content was bought with the Yahoo! Apple ID but you now want the Gmail address for your Apple ID, the trick will be to change the address used for the Yahoo ID with the Gmail address. However, to do that you must first free the Gmail address from that other Apple ID. Use the instructions from Apple to substitute another address that is not used as an Apple ID for your Gmail address in the Apple ID with the Gmail address. Then, when the Gmail address is no longer used in an Apple ID, you can use the same instructions to substitute the Gmail address for the Yahoo address in the Apple ID with the Yahoo address.
    Changing the email address you use for your Apple ID -
    http://support.apple.com/kb/HT5621

  • The word app has disappeared from my desktop computer and can't be found on finder or search. All documents I created on word will now not open unless in "TextEdit" format which I don't use. Any ideas please? Thanks

    The word app has disappeared from my desktop computer and can't be found on finder or search. All documents I created on word will now not open unless in "TextEdit" format which I don't use. Any ideas please? Thanks

    Did you recently erase and/or reinstall the OS?
    And, some details are needed: model/year Mac, Mac OS version running now and which version originally).

  • I created an iMovie using pictures from my camera roll, I exported the movie to the camera roll and then deleted all of the pictures. Now I can't get the movie to play. Did deleting the pictures cause my IMovie to disappear? How can I get my movie back?

    I created an iMovie using pictures from my camera roll, I exported the movie to the camera roll and then deleted all of the pictures. Now I can't get the movie to play. Did deleting the pictures cause my IMovie to disappear? How can I get my movie back?

    Download and open this program, lets you look around your I phone as if it was a disc drive, might find em in the iphones drive.
    http://www.macroplant.com/iexplorer/

  • Creating sets using a table data

    Hi,
    I have a table  TVBVK which is for sales and not related to FI data. I am trying to create sets so that the sales office would be the parent node and the sales group would be the child. I am using GS01 and it seems that it would not work because the parent which is the sales office value that is different from the child value that is the sales group. 
    How would I create an hierarchy using sets by reading from this table? Would it be possible? Could I create sets so that the field names are different?
    Thanks

    Hi,
    How woull that be? Would you elaborate why?
    Thanks
    Will

Maybe you are looking for

  • If anybody can solve this, they win.

    I have a 15gb third generation (3g) ipod. Bought in April 2003, fully functional until about april 2006, at which point it stopped turning on all together. My thought? I made a homemade battery-pack out of an altoids tin, some batteries, and some sol

  • Unicode conversion with MDMP, Errors in various TC´s SAINT , SNOTE,

    Hallo All, We perform CU&UC of R/3 4.6C sandbox system to the ERP 6.0 EHP5. Currently the upgrade phase is completed and Unicode conversion should be started (we are in the step "Additional Preparation Steps in NW 7.02 non-UC" in the CU&UC guide). In

  • Screen Issues

    Anyone in the community know how I can fix a cracked screen of about 1mm in length? (felt the uneven surface and screen displays colour through the crack, what you normally find in a chipped screen) I understand that by using toothpaste it will only

  • SQL Developer 1.5 - Exporting Data

    Hi, I am using SQL Developer 1.5 and trying to run query and asving the data to to file but having following problems. 1) How to save data as pipe or other delimitted data in text file? 2) when i am saving as text file, its taking longer but when its

  • Does migrating database to 7.8  change the structure or ? of the database?

    Good Morning Community, I had migrated Maxdb Database from 7.6 to 7.8 and i realize the dbmcli connect to the database but he prints this error when i execute my usual queries: ERR -24988,ERR_SQL: SQL error -4004,Unknown table name or unknown schema: