How to get the same period last year value using Fiscal Calendar?

Hi there,
I am using DAX in a Tabular Model project but I am getting stuck trying to get the following:
We are using a Fiscal Calendar (from 01 April to 31 March). 
Previous Period Value
       Value
2012
April
15
May
10
Jun
20
2013
April
15
30
May
10
20
Jun
20
25
I have tried to use sameperiodlastyear but there is an error saying that this function cannot be used for non contiguous dates. DATEADD is given the same error...
Could anyone help me getting the right measure expressions for [Previous Period Value]?
Thanks and best regards,
Joss

Hi Joss,
In SQL Server Analysis Services, we can can compare revenue with the hierarchy periods (year, month, day) by using the PARALLELPERIOD function, and now you want to compare with custom periods. (NOTE: We cannot compare it with the PARALLELPERIOD function
since
PARALLELPERIOD function returns a member from a prior period in the same relative position as a specified member. So if the first time span not equal to the second one (such as the first period is 3 days, and the second period is 2 month)).  Here
is a sample query about PARALLELPERIOD function for your reference.
with
set Hotels as
[Hotels].[Hotel ID].&[1015],
[Hotels].[Hotel ID].&[5640],
[Hotels].[Hotel ID].&[8800]
set Period as [Arrival Date].[Date].[Month].&[2012]&[1]:[Arrival Date].[Date].[Month].&[2012]&[12]
member [Arrival Date].[Date].[0] as sum({ Period })
member [Total Amount N-1] as (PARALLELPERIOD([Arrival Date].[Date].[Year], 1, [Arrival Date].[Date].[Year].&[2012]), [Measures].[Total Amount])
select
[Measures].[Total Amount],
[Measures].[Total Amount N-1]
} on 0,
nonemptycrossjoin
Hotels,
Hotels.[Hotel].children,
*{[Arrival Date].[Date].[0]}
} on 1
from [Booking_Cube]
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • How to get the first or last row value from a group using ntile

    I want to query and use ntile to divide by data in 4 groups (quartiles). I got this part no problem and it returns the list of rows and the ntile bucket value for each one.
    What I want though is to get only the first row from each ntile group (so in effect the max, q3, median, q1 and min values from the whole result). Of course I coud get max, min and median directly using the other functions, but how about the values for q3 and q1?
    My query contains this:
    NTILE(4) OVER (ORDER BY salary DESC NULLS LAST) as ntile
    So I want the highest, lowest, middle, q3 and q1 values for the salaries.
    Should I be using NTILE, ROWNUM, PERCENTIL_DIST....?
    Any ideas? Thanks in advance.

    SQL> select ename,sal,
      2  NTILE(4) OVER (ORDER BY sal DESC NULLS LAST) as ntile
      3  from emp
      4  /
    ENAME             SAL      NTILE
    KING             5000          1
    FORD             3000          1
    SCOTT            3000          1
    JONES            2975          1
    BLAKE            2850          2
    CLARK            2450          2
    ALLEN            1600          2
    TURNER           1500          2
    MILLER           1300          3
    WARD             1250          3
    MARTIN           1250          3
    ENAME             SAL      NTILE
    ADAMS            1100          4
    JAMES             950          4
    SMITH             800          4
    14 rows selected.
    SQL> select  ename,
      2          sal
      3    from  (
      4           select  ename,
      5                   sal,
      6                   ROW_NUMBER() OVER (PARTITION BY ntile ORDER BY sal DESC NULLS LAST) as rn
      7             from  (
      8                    select  ename,
      9                            sal,
    10                            NTILE(4) OVER (ORDER BY sal DESC NULLS LAST) as ntile
    11                      from  emp
    12                   )
    13          )
    14    where rn = 1
    15  /
    ENAME             SAL
    KING             5000
    BLAKE            2850
    MILLER           1300
    ADAMS            1100
    SQL> SY.

  • User exit to calculate Same period Last Year

    Dear gurus,
    can some help me to code the user exit to calculate the same period last year for bex variable
    i.e
    System date :18.05.2010
    Same period last tear : 18.05.2009
    Your help  highly appreciated
    Thank you
    BR

    Hi,
    The above code creates problem only when date is 29th of Feb.
    To find whether year -1 is leap yr or not include following code also:
    l_year = sy-datum(4)-1 .
    l_mod4 = l_year mod 4.
    l_mod100 = l_year mod 100.
    l_mod400 = l_year mod 400.
    if ( l_mod4 = 0 and l_mod100 ne 0 ) or l_mod400 eq 0.
    if( l_date = 29)
    l_date= l_date -1.
    endif.
    endif.
    Modify your code according to youe need. Hope this helps you.
    Thanks,
    Jitender.

  • How to get the split period wage type amount in payslip?

    How to get the split period wage type amount in payslip?
    Payroll period for 01.01.09 to 31.01.09.
    1.     Employee is active from 1.1.09 to 10.01.09
    2.     Employee is inactive from 11.01.09 to 20.01.09
    3.     Employee is again active from 21.01.09 to 31.01.09
    In Result Table three split periods are created.
    From 01.01.09 to 10.01.09 u2018Basic Salaryu2019 Wtype  1101 amt is 20.00
    From 11.01.09 to 20.01.09 u2018Basic Salaryu2019 Wtype 1101 amt is 00.00
    From 21.01.09 to 31.01.09 u2018Basic Salaryu2019 Wtype 1101 amt is 10.00
    My requirement is to print only the last split period in payslip from 21.01.09 to 31.01.09. May you please help me in this regard.
    Thanks in advance
    Regards,
    Rajesh.

    Hi
    Try to read the below:
    WPBPC : Distribute Lump Sum Wage Elements to WPBP Periods
      Object
        Operation
      Use
        Operation WPBPC distributes the amount of the current wage type to the
        active WPBP periods in the payroll period.
      Input
        The current wage type in the header entry of table OT is used as input
        for this operation.
      Procedure
        Within payroll, wage types are assigned to a fixed WPBP period by
        infotype 0014 Recurring Payments/Deductions, for example. However, you
        may want to distribute this payment to all active WPBP periods, which is
        what would happen if the wage type were entered in basic pay. Therefore,
        various specifications exist for parameter S:
        o   If the specification is 'A', and if several active WPBP periods
            exist, the amount is simultaneously reduced on a calendar-day basis.
        o   If the specification is 'D', the wage type is distributed to all
            existing WPBP periods without the amount being reduced.
        o   If the specification is 'S', and if the validity period starts or
            ends during the period, the entry in table WPBP is split using this
            date. The wage type is stored in table OT for the corresponding WPBP
            period.
            This parameter is only allowed if processing was accessed using
           function P0014.
           In this case, infotype 0014 must be processed before absence
           valuation and function PARTT. Otherwise, rejections occur during
           payroll processing.
       o   Specification 'X' is the combination of 'A' and 'S'.
           This parameter is only allowed if processing was accessed using
           function P0014.
       o   If the specification is 'W', and if the validity period starts or
           ends during the period, the entry in table WPBP is split using this
           date (as with option 'S'). Unlike 'S', the wage type is not stored
           in table OT.
           This parameter is only allowed if processing was accessed using
           function P0014.
       o   If the specification is ' ', the wage type is stored in table OT for
           each WPBP period in which the validity interval fits.
           This parameter is only allowed if processing was accessed using
           functions P0014 or P0015.
       If the WPBP split is set for a wage type, the wage type is stored
       without changes in table OT. If you specify a different wage type name
       in the second parameter, the wage type is stored with this name in table
       OT. Before you execute operation WPBPC, you may therefore need to delete
       the split using operation ELIMI.
       If a country-specific split (C1, C2, or C3 split) is set, the operation
       interprets it as an error. The employee in question is rejected by
       payroll. All other splits are transferred as they are.
      Output
        The processed wage type, or the wage type specified in the operation
        call, is written to table OT (output table) with the appropriate split
        indicator and reduced amount as operation output for each WPBP period.
        Parameter specification 'W' is the only exception.
      Syntax
        OOOOOSVVVV
        OOOOO       WPBPC       Operation name
        S
                    blank       distribute to all WPBP periods
                    S           split and distribute WPBP
                    W           split but do not distribute WPBP
                    A           distribute to active WPBP periods
                                with calendar-day reductions
                    D           distribute to all existing
                                WPBP periods
                    X           combination of 'S' and 'A'
        VVVV                    Results wage type
                    blank       input wage type = results wage type
                    wage        wage type name of input wage type is replaced
                     type       by wage type name of results wage
                     name       type
        Wage type before operation:
      Example
        M100        02          3000
        WPBP split
        01  June 01 - June 20 active
        02  June 21 - June 30 active
        VVVV                    Results wage type
                    blank       input wage type = results wage type
                    wage        wage type name of input wage type is replaced
                     type       by wage type name of results wage
                     name       type
        Wage type before operation:
      Example
        M100        02          3000
        WPBP split
        01  June 01 - June 20 active
        02  June 21 - June 30 active
        Wage type before operation:
        WType       WPBP        Amount
        M100        00          3000.-
        M200        02          2000.-
        Operation:   WPBPCA
        Wage type after operation:
        WType       WPBP        Amount
        M100        01          2000.-
        M100        02          1000.-
        M200        02          2000.-
        Operation:   WPBPC
        Wage type after operation:
        WType       WPBP        Amount
        M100        01          3000.-
        M100        02          3000.-
        M200        02          2000.-
    Regards
    Team Member.

  • "Data only" csv export. How to get the same data?

    When I export to csv I get more data than when exporting to "data only". Why and how to get the same as when using "data only". I suppose it is because of some supressed lines, but why there is difference in the view (which is right) and in the export file?
    I do not want to export to xls with "data only" and save as csv, because the exported csv is being read by another application, which is unable to convert it automatically.
    The other way is to put constraints in the data selection for the whole report (and not by supressing lines). How to say {table.date}>=maximum({table.date}) in the  in the data selection? There is not possible to use "maximum". Probably possible with array?
    Thanks in advance
    Edited by: Kiril Bojilov on Aug 4, 2009 12:34 PM
    Ok, I managed it: I put the constraint in the group selection
    Edited by: Kiril Bojilov on Aug 4, 2009 12:46 PM

    New customers get more options because new customers didn't already agree to complete a 2yr contract before being able to get a new phone. If you had a line that wasn't under contract, you would get a better deal than new customers because while they pay $35 activation fee for a new line, you pay $30 upgrade fee for using an upgrade. You just have to finish your end of the deal before you can start a new one.

  • How to get the customize url of an portlet using PLSQL

    How to get the customize url of an portlet using PLSQL.

    Are you trying to call the portlet Customization form directly from the browser?

  • How to get the size of physical memory by using system call ?

    how to get the size of physical memory by using system call ?What system call can be used for me to get the size of physical memor? thanks.

    %vmstat 3
    procs memory page disk faults cpu
    r b w swap free re mf pi po fr de sr s0 -- -- -- in sy cs us sy id
    0 0 0 3025816 994456 4 19 6 0 0 0 0 8 0 0 0 459 253 139 1 1 99
    0 0 0 2864688 777408 0 2 0 0 0 0 0 3 0 0 0 428 134 175 0 1 99
    0 0 0 2864688 777408 0 0 0 0 0 0 0 7 0 0 0 448 112 166 0 0 100
    one interesting observation about vmstat I found out is (mostly on Solaris)
    the first line of information always off chart, so I usually do a few interval to get constant result.
    if you use linux
    just
    cat /proc/meminfo

  • Hi..I purchased a Pantum p2000 printer and I cannot use it. It gives me an error ( Stopped, Filter failure) I tried to re-install the driver several times but I still get the same message. I'm using OS X Yosemite 10.10.1

    Hi..I purchased a Pantum p2000 printer and I cannot use it. It gives me an error ( Stopped, Filter failure) I tried to re-install the driver several times but I still get the same message. I'm using OS X Yosemite 10.10.1

    If you haven't done so already, try resetting the printing system.
    OS X Mavericks: Reset the printing system  also Yosemite

  • How to get YTD sale for Last year In OBIEE 11g

    Hi All,
    I have a fact table for Sale_Amt with doc_date wise details. It is connected to Simple time_dimension table based on Date_ID(Number) field. The time_DIm Hierarchy is set on Year, Quarter, Month fields of the time_dimension table.
    One of my reporting requirement is to show show YTD sales and Last Years YTD sales.
    e.g, If user select 23 Jul 2013 as the date parameter, I need to show 1-Apr-2013 till 23 Jul 2013 Sales in YTD column and 1-Apr-2012 till 23 Jul 2012 Sales in Year_Ago_YTD column. I am able to get YTD sales but unable to derive at Year_Ago_YTD sales figures.
    Finacial Year Start from 1st April till 31 March.
    Any Help on this will be appriciated.
    Thanks.
    Narendra Shetty.

    Narendra,
        You can make use of the below two functions to get the year ago dates. You can replace current_date with a presentation variable that stores the date parameter that user selected.
    TimestampAdd(SQL_TSI_YEAR,-1,TIMESTAMPADD(SQL_TSI_MONTH, 3,TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) - It will display previous year's first day of fiscal year (since I passed current_date, it gives you 1st april 2012)
    and
    TimestampAdd(SQL_TSI_YEAR,-1,current_date) - Same Day Last year
    Pls mark correct/helpful.

  • How to get the same colored labels as in the gmail web interface?

    Hi,
    I would like to get the same preview in Mail.app (with different colored labels) as in Gmail. Currently, my Gmail account in synced with Mail.app, hence I have access to all my mailboxes (hence all my labels). I would like to add a rule which reads as :
    if Message is in (gmail label mailbox)
    then Set color to (color)
    However, this feature doesn't seem to be here. Basically, how to automatically colored a message being in a given mailbox (to get a nice rainbow in my general Inbox).
    Thanks in advance!
    Damien

    I'm pretty sure you can't do that in Mail. If you do find out, post back—I'd like to know too!

  • I bought my I Phone 5S from Dubai, it doesnt have facetime, how to get the same on my I phone. I am based in India

    I am based in India, and during my travel to Dubai in recent past i bought I phone 5 S. After reaching my country and i started using my new phone and i am surprised to find that it doesnt have facetime. How do i get the same??

    rakeshfromkolkata wrote:
    How do i get the same??
    You get a new phone not made for KSA and UAE markets. There is no way to get FT on your phone as it has been permanently crippled by law.

  • How to Get the numeric equivalent of Year and Month with this format....

    Hi Experts!
    I just would like to know how to get the numeric equivalent of the Year and Month if the given format is like this....
       31-May-07
    where:
    31 is the Day
    May is the Month
    07 is the Year
    Is there a function in ABAP to do this? I wouldn't mind hardcoding for the Month, but what I'm after is the year.... they only gave me 2 digits for the year... and I would like to extract 4 digits from it... do ABAP still recognize it as '1907'? I think not...
    Please help me on this experts and Thank you in Advance!!!
    More Power!

    Hi Jayson,
    You can require 2007 or 2017 or 2027..
    or 1937 . or 1947 .. so on,
    so just put a logic based on this. Just hard code as
    lets say value is 31-May-07 (9 char field)
    Case field+7(1).
    WHEn 0.
    concatenate '200' field+8(1) into year.
    WHEN 1.
    WHEN 2.
    WHEN 3.
    jsut code like this and check the syntaxes.
    Reward points if useful.
    Regards,
    Atish

  • How to get the same look as flash for borders?

    Hi i have selected circle and filled the circle with some color. now i want to have border around the circle so i have saelected stroke from the edit menu and applied with one pixel. how ever it is not giving a solid look as in flash. in photoshop the border looks like disolved and transparent. is there a way to get the same look as flash?

    Look at the image. i have described everything there in the image itself. even when we use layer style it is the same problem. is there a way to resolve this? the text in the image is as below.
    if u carefully observe the circle pointed there is a slight gap between the border and the filled color. This is not good. i dont want any gaps between the border and the filled color. I have used bucket to fill the circle and used stroke from edit menu to get the border for the circle.

  • Findsmb not on lion.. how to get the same information

    I need the list of samba share on a local network.
    how can I get the same result of findsmb command available on snow leopard and not on Lion?
    I need these information via command line.
    How can I use command like smbutil, nslookup... or what to obtain the list of Netbios name and IP (like findsmb output).
    PS: sorry for my english

    At this time it is not possible to do what you want. Genius mixes in iTunes are on iOS devices are simply going to be different.

  • How to get the job logs from sm35 by using the queue id and session name?

    hi all,
    can any one please let me know how to read the job log from sm35 by using the session name and queue id. i have the job name and job count but is it possible to download the job log by using the queue id and session name.
    FYI..
    i want to read this job log and i want to send it to an email id.
    -> i am using the job_open and submitting the zreport via job name and job count and then i am using the function module  job_close.
    but this is not working in my scenario i have the queue id and session name by using this two i want to get the job log is there any function module available or code please provide me some inputs.
    thanks in advance,
    koushik

    Hi Bharath,
    If you want to download it to the local file then you can follow the instructions in the below link.
    How to download Batch Input Session Log?
    Regards,
    Sachin

Maybe you are looking for

  • Text Field is not displaying in MIRO , Screen Variant SHD0

    Hi, All Experts. In my client TEXT field is not there in MIRO T.code. I heard Screen Variant can be a good option for adding field in MIRO. Or is there any work around to bring TEXT ( SGTXT ) field in MIRO ? I gone through the already posted threads

  • Looking for Service Guide for HP Envy H8-1414

    My H8-1414 needs a new bluetooth/wireless card, and there is one on buy.com that I hope could work, but I can't locate a list of compatible cards for this PC.  Would a Intel Centrino 6235 IEEE 802.11n Mini PCI Express Bluetooth 4.0 - Wi-Fi/Bluetooth

  • Error while installing SQL Server 2008 R2 in Windows 7 SP1 machine

    Hi Team, Error while installing SQL Server 2008 R2 in Windows 7 SP1 machine. I can confirm this machine has .Net Feature enabled and with Latest version. TITLE: Microsoft SQL Server 2008 R2 Setup The following error has occurred: Error 25541.Failed t

  • Slice Exports as table instead of Div

    Using FW CS5, when I export a sliced image to .htm file, the contents are all in a <table> format instead of as <div> tags, for example; <table style="display: inline-table;" border="0" cellpadding="0" cellspacing="0" width="1024">   <tr>    <td cols

  • How can I fix incorrect connections caused by duplicate file names?

    I have many slides, scanned over the past 10 years, with duplicate file names and filed by date.  I converted my Elements 9 from PC to iMac and many incorrect connections occured.  Is there a way I can correct these connection errors?  This problem i