How to get start date of the period for a given date from cube

I have a situation where i need to find the start day of the period for a given date. is there a way to know that. i want to use that in my report. i enter the date from my report(i have date parameter), depends on the date, i want to display the start day
of the period. how can i write expression for that in my report?
ram

Hi ramprasad74,
According to your description, you are using Analysis Services as a data source for the report, the cube has hierarchy: Fyear, FQuarter, FPeriod, fweek, Fdate. You want to add a date parameter to the report, after you changed value of the parameter, the
report will return the first day of FPeriod.
To achieve your goal, we need to add a parameter to the report, then use the parameter in mdx query. For detail information, please refer to the following steps:
In the Report Data pane, right-click on a dataset created from a SQL Server Analysis Services data source type, and then click Query. The MDX query designer opens in Design mode.
On the toolbar, click Design to toggle to Query mode.
On the MDX query designer toolbar, click Query Parameters symbol. The Query Parameters dialog box opens.
In the Parameter column, click <Enter Parameter>, and then type the name of a parameter.
In the Dimension column, choose a value from the drop-down list.
In the Hierarchy column, choose a value from the drop-down list.
In the Default column, from the drop-down list, select a single value.
Click OK. 
In query designer dialog box, type the mdx query like below:
with member [Measures].[FirstChild]
as
[Date].[Fiscal].currentmember.parent.firstchild.name
select {[Measures].[FirstChild]} on 0,
[Date].[Fiscal].[Date].members on 1
from
( SELECT ( STRTOSET(@ParameterName, CONSTRAINED) ) on 0
from
[Cube]
Here are relevant threads you can reference:
https://social.msdn.microsoft.com/forums/sqlserver/en-US/c7146ac3-40ea-4d53-b321-c707aebbd405/how-to-pass-date-parameter-to-mdx-query
https://social.msdn.microsoft.com/forums/sqlserver/en-US/fd12a865-bc90-4a65-af42-ce38a8cfa29b/pass-date-time-parameter-to-mdx-query-ssrs
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
If you have any feedback on our support, please click
here.

Similar Messages

  • Find 3rd friday of the month for a given date

    how to find out 3rd friday of the month for a given date? I can always pass the first day of the month as input
    eg, input date is 01-JAN-09. need to get the 3rd friday 16-JAN-09 (Jan has 5 fridays 02, 09, 16,23,30)
    input date : 01-feb-09, need to get 20-feb-09
    Edited by: user520824 on Apr 1, 2009 12:30 PM

    NLS independent solution:
    SELECT  DT,
            TO_CHAR(DT,'FMDay') day,
            CASE
              WHEN TRUNC(TRUNC(DT,'MM') + 7,'IW') - 3 < TRUNC(DT,'MM') THEN TRUNC(TRUNC(DT,'MM') + 7,'IW') + 18
              ELSE TRUNC(TRUNC(DT,'MM') + 7,'IW') + 11
            END THIRD_FRIDAY_OF_THE_MONTH
      FROM  (
             SELECT  TO_DATE(LEVEL || '/2009','MM/YYYY') DT
               FROM  DUAL
               CONNECT BY LEVEL < 13
    DT        DAY       THIRD_FRI
    01-JAN-09 Thursday  16-JAN-09
    01-FEB-09 Sunday    20-FEB-09
    01-MAR-09 Sunday    20-MAR-09
    01-APR-09 Wednesday 17-APR-09
    01-MAY-09 Friday    15-MAY-09
    01-JUN-09 Monday    19-JUN-09
    01-JUL-09 Wednesday 17-JUL-09
    01-AUG-09 Saturday  21-AUG-09
    01-SEP-09 Tuesday   18-SEP-09
    01-OCT-09 Thursday  16-OCT-09
    01-NOV-09 Sunday    20-NOV-09
    DT        DAY       THIRD_FRI
    01-DEC-09 Tuesday   18-DEC-09
    12 rows selected.
    SQL> SY.

  • Find the 'DAY' for a given 'DATE'

    Hi Folks,
    I need a help regarding finding the day for a given date.
    My requirement is that..,
             If I enter a date using 'parameters', it should write the 'day' for the corresponding date.
    To be more specific.....,
    if I enter date as ' 07/15/2008 ' it should return me  the day as 'Tuesday'.
    Regards,
    Naveen G

    HI,
    FM LIST WITH RESPECT TO DAY, WEEK, AND MONTH.
    CALCULATE_DATE : Calculates the future date based on the input .
    DATE_TO_DAY : Returns the Day for the entered date.
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET : Get the names of the month
    WEEK_GET_FIRST_DAY : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS : Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
    Reward points if useful,
    siri

  • FM to find week start and end date on the basis of a given date

    Hi Everyone,
    I have a requirement in which I require the week start and end date  of any given date.
    For eg: The given date is Wednesday 24.03.2010, I need a function module to calculate the week start date ie. Monday 22.03.2010 and week end date ie. Sunday 28.03.2010 on the basis of that date.
    Any input to this query would be helpful.
    Thanks,
    Nimisha Agarwal
    Edited by: Nimisha Agarwal on Jul 7, 2010 7:47 AM

    HI nimisha,
    many posts r there for this .
    Kindly check  before posting
    anyways this FM will serve u  r purpose.
    GET_WEEK_INFO_BASED_ON_DATE

  • How to get business activity with status open for a given BP ?

    Hi,
      I want to get the business activity status for a given business partner.
      To be more specific , consider the following customer service scenario:
    Requirement:
    Customer will call the call center
    Call center will create that business partner and BP will be assigned to proceed with the customer requirement
    A report program has to be generated to get the list of customers pending for the given business partner
    Things done:
    I have created a business partner(consumer) through the transaction CIC0
    Now I need to write a report program which will fetch all customers pending(with business activity status open) for a given business partner
        The thing is we are not able to find out where the status of the business activity is maintained.
        Is there any BAPI to meet out this requirement? or is there any other way?
    Regards,
    Arokiaraj. S,
    Asian Paints

    Hello,
    Try BAPI BAPI_BUSPROCESSND_GETLIST to get the activities for a BP and CRM_ORDER_READ to get the status.
    You also use FM CRM_STATUS_CHECK to check the status.
    Regards,
    Frédéric
    Message was edited by: Frederic Schoenaers

  • How to get started after receving the email invitation

    I have send out an invitation to a new users. When she open the system prompt which software to purchase? We already have 11 licenses for the company and 2 are not assigned yet.

    Thank you John. I am sorry I believe I did not phrase the question correctly. I should have asked, how does the person who gets invited "download" the software. After clicking on the link in the invite, the screen prompts her to select the software to download and they all have the prices.

  • How to get XLR to show BPs with no transaction data for a given date range

    Hi -
    I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
    The report has the row expansion:
    FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
    and column expansions:
    FIG(SO_TaxDate = @StartDate:@EndDate)
    and
    FIG(SO_TaxDate = @StartDate2:@EndDate2)
    where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
    The column formulas are, from left to right:
    =ixDimGet("BPA", "CardName")
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for first date range
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for second date range
    The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
    Any help is greatly appreciated!
    Thanks,
    Lang Riley

    Really appreciate your feedback!  Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
    Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query. 
    Using **, i.e., * or #NULL, makes no change in the resulting data in this case.  I had thought that ** would be the solution, but it didn't change the outcome.  I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear. 
    I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set.  It seems that perhaps the IXL query needs to be restructured?  Please keep the suggestions coming including how this query might be restructured if necessary.

  • How to get period date of for a given month from a given date in mdx for SSRS report (mm/dd/yyyy)

    I have a situation,  where i need to write expression Period to date(PTD). i want to know how to get the period date. i want you to help in writing Period date or else is there any function to get period date for a given date(the  date is given
    from the parameter dynamically) in MDX for SSRS report
    ram

    Hi ram,
    Per my understanding that you want to get the period date based on the month selected and the given date, right?
    Could you please provide details information below to help us better understanding your requirements, thus we will be more effective to provide an solution:
    What is the format of the period date you want to get, is this date in the DB and you want to filter it based on the month and the given Date?
    Did the month and given date are two parameters in the report? if possible, could you please provide some sample data in the DB and also the snapshot of the report structure
    I assume you want to get the period date(mm/dd/yyy) between the select month(e.g:Feb) and the given date (10/1/2014) and you should get the date between(02/01/2014-10/1/2014).
    If so,and you also have two parameter "Month","EndDate"(EndDate is the given date), please reference to details information below:
    You can create an new parameter "BeginDate" (Date/Time) which is the begin date of the period, you can use the expression to get the value based on the value of the month and the year value from the given date,finally hide this parameter:
    Specify the available value:
    Label:=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value)
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Specify the default Value:
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Add filter to the dataset as below:
    Preview you will get all the date in the given Period:
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • How to get the date of first day of a week for a given date

    Hi gurus
    can any one say me how to get the date of first day(date of Sunday) of a week for a given date in a BW transformations. For example for 02/23/2012 in source i need to get 02/19/2012(Sunday`s date) date in the result. I can get that start date of a week using  BWSO_DATE_GET_FIRST_WEEKDAY function module. But this function module retrieves me the  start date as weeks monday(02/20/2012) date. But i need sundays(02/19/2012) date as the start date. So it would be really great if anyone sends me the solution.
    Thanks
    Rav

    Hi,
    The simplest way would be to subtract 1 from the date date which you are already getting in transformation routine, but instead of doing that subtraction manually which might need bit of errort, you can simply use another FM to subtract 1 from given date.
    RP_CALC_DATE_IN_INTERVAL
    Regards,
    Durgesh.

  • I deleted most visited, latest headlines, getting started, yahoo, youtube, apple in mozilla's folder,how to get it back like the first time i installed? thx

    i deleted most visited, latest headlines, getting started, yahoo, youtube, apple in mozilla's folder,how to get it back like the first time i installed? thx

    if you hid the menu bar and the navigation bar simply press the alt button, this will bring back the menu bar and form there you can right click and select which bars you want shown

  • I purchased an iPad mini on October 10th.  I want to return it and get the new ipad mini retina when it comes out.  How do I do that if the new ipad mini release date isn't until "later in November", which is beyond the 14 days from my purchase date?

    I purchased an iPad mini on October 10th.  I want to return it and get the new ipad mini retina when it comes out. I am currently still within the 14 day return/exchange window but how can I exchange it if the new ipad mini release date isn't until "later in November", which would be beyond the 14 days from my purchase date?  If apple announces a new version of a product you just purchased but won't actually release it for more than 14 days, how can you possibly exchange the one you just bought?  Is my only option to return the one I bought on the 10th (so return by 10/24) and then not have an iPad until the new one is available for purchase?  Or would it make any sense to return the one I bought, get a new one, which would presumably have another 14 day return window, and then exchange THAT one for the new ipad mini w/ retina when it comes out (hopefully within that second 14 day window)?

    Call the apple store you got it from and ask them. Sometimes in the past they've extended the 'no questions asked return' but only Apple can tell you for sure.

  • How to get previous day of the date

    Hi,
    for a given date I need one day minus as a result date
    my input would be any date
    for example :
    Input Date : 2006-03-22 ( yyyy-mm-dd)
    Output should be : 2006-03-21
    If my input is 1st of April 2006, output i would expect is 31st March 2006
    Please suggest how to achieve this
    Thanks in advance
    Nilesh

    Find below the code to get previous day of the current date
    import java.util.Date;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    public class PreviosDay
    public static void main(String[] args)
    DateFormat dateFormat = new SimpleDateFormat( "MM/dd/yyyy");
    Calendar cl = Calendar.getInstance();
    // you can use a Date object's getTime() method , which is initialiazed
    // to desired date here directly ex: Date dt = new Date("10/10/2004");
    // cl.setTimeInMillis(dt.getTime());
    cl .setTimeInMillis(System.currentTimeMillis());
    cl.add(Calendar.DAY_OF_MONTH, -1);
    System.out.println("Previous date : "+dateFormat.format(
    new Date(cl.getTimeInMillis() ) ) );
    }

  • How to get the week number for a given date?

    hi guys,
    what is coding to get the week number for a given date?
    For example, 1/1/05 is week 1. then 8/1/05 is week 2.

    The second parameter to pass to the method is supposed to be one of the month constants JANUARY - DECEMBER. It happens to be that their numerical values are 0-11, not 1-12, so your "12" refers to the "13th" month of the year.
    givenDate = new GregorianCalendar(2003, Calendar.DECEMBER, 31);
    If you want to construct dates and times from strings like you seem to be, look into SimpleDateFormat http://javaalmanac.com/egs/java.text/ParseTime.html
    (even still I got WEEK_OF_YEAR as 1 which is true but not really what I expected, excuse my previous reply but I wanted to check the facts before posting this)

  • HT4889 Replacing System hard drive with a new one. How to get everything over to the new boot drive?

    Replacing System hard drive with a new one. How to get everything over to the new boot drive? Should I use Carbon Copy or does apple have a better untility to do this?
    I can't get my current system drive (OSX 10.8.3) to start on the first try. I always have to shut down and restart again to finally see the Apple logo.
    Have used disc utility to repair the disc and permissions several times and that works. The next time I boot up, it works fine and I get the apple logo, but then the second time I boot up, it's back to the blank screen again and it only boots after the second try.  I have tried this repair three different times now always with the same result. Works right the first try (after the repair) then from the second time on it doesn't work. I just get the white screen until I reboot a second time.
    Thinking I should change drives but what's the easist and best way to move everything over to the new drive so it will boot correctly with all my data on it. This is the system drive for a Pro Tools 10HD setup. MacPro 3,1 with 16 gigs ram and OSX10.8.3 on it.
    Thanks for any help!

    If you have a time machine back up of your current drive you can do this
    Shut down your computer, install the new drive. While the computer is off plug in the external hard drive that you have your time machine back up on. Hold Option key while the computer turnes on, let go of the option key once you get a grey screen. Shortly after you'll see  a list of bootable drives, select the one that has your time machine back up on it and boot into that drive.
    From there go into disk utility, format your new drive too, osx extended journaled ( I think, double check that, its been awhile since ive had to do this), hit format
    Exit disk utility and then you can use time machine to copy all your exisit data to the new hhd and then your pretty much done.
    There is also a program called Carbon Cloner that will do esentially the same thing however I've never uesed it.

  • How to get each thread in the threadpool

    Hi,everyone.I'm now learning java.util.concurrent package and I have two questions about the threadpool.
    1) How to get each thread in the threadpool;
    2) How to get each thread's data in the threadpool and dispaly them onto GUI;
    e.g :
    There are 5 threads in the threadpool(ThreadPoolExecutor) and I have 100 tasks(Runnable or Callable),every task scans a directory(every task scans a different directory),how can I display the "real-time" count of the files in the directory which the current 5 threads in the threadpool scan onto the ListView Items in the GUI?

    Willings wrote:
    Hi,everyone.I'm now learning java.util.concurrent package and I have two questions about the threadpool.
    1) How to get each thread in the threadpool;You don't
    2) How to get each thread's data in the threadpool and dispaly them onto GUI;
    e.g : You don't
    There are 5 threads in the threadpool(ThreadPoolExecutor) and I have 100 tasks(Runnable or Callable),every task scans a directory(every task scans a different directory),how can I display the "real-time" count of the files in the directory which the current 5 threads in the threadpool scan onto the ListView Items in the GUI?You should notify your "monitor" when you add something to the pool, and the Runnable/Callable should notify the same "monitor" when it starts to execute, and during its processing. Finally you notify the monitor when the execution has completed.
    Kaj

Maybe you are looking for