Year to date etc...

Post Author: Optimus
CA Forum: Desktop Intelligence Reporting
Hi all,fro the first time I am trying to implement a year-to-date , month-to-date and similar measures into my reports. I tried approach with second data provider with restriction to date; the problem is, I can not write something like WHERE measures.year = Year(CurrentDate()) - 1   (for last year measure)    Please, what is standard approach to calculated measures that I need?Thank you.

Post Author: Peter@KLM
CA Forum: Desktop Intelligence Reporting
make a variable like this: FlagCY = If (measure.year = year(CurrentDate()) then "CY" Else "PY"
and two others:
TurnoverCY = <Turnover> where (<_Flag_CY> = "CY")
TurnoverPY = <Turnover> where (<_Flag_CY> = "PY")
Now you can do anything you like with these two variables

Similar Messages

  • Year to Date and Monthly totals

    I know that this is rather simplistic, but I'm new to Discoverer and need to set up a bunch of sales reports with MTD and YTD columns. I'm going to be using the same SQL query for many of my reports but customizing the reports to show sales by state, product line, etc.
    Is there a formula/function I can use in Discover for the Month to Date and Year to Date totals?
    Thanks,
    Joseph

    Hi Joseph
    You can use the analytic range SUM calculation for these. For the month to date, use the a PARTITION BY of month with a range of all the preceding rows in the partition up to and including the current row. For the year, you would simply change the PARTITION BY to be the year.
    Here are some examples drawn from my own database:
    I have the following items:
    ORDER_YEAR
    ORDER_MONTH
    ORDER_DATE
    SELLING_PRICE
    With these defined, the formula for month to date is:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS UNBOUNDED PRECEDING)
    The formlua for year to date is:
    SUM(Selling Price SUM) OVER(PARTITION BY ORDER_YEAR  ORDER BY  ORDER_DATE ASC  ROWS  UNBOUNDED PRECEDING )
    Basically what we are doing is telling Discoverer to SUM the SELLING_PRICE, and you should be able to take these and adjust them for your own report.
    Let me take a look at the month to end and describe what is going on. Basically the PARTITION BY is defining a set of rows which are to be included. In this case it is all rows that have the same ORDER_MONTH. The ORDER BY clause tells Discoverer to place the items in order, with the oldest order first. The ROWS UNBOUNDED PRECEDING tells Discoverer to SUM all of the items within the set (within the PARTITION BY) from the oldest item (UNBOUNDED PRECEDING) to and including the current item. We could have added a BETWEEN clause too but that is implied. With a BETWEEN clause it would look like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    If you want the current row to be included with UNBOUNDED PRECEDING you don't need to explicitly name it because that is the default. Other options you could use are these:
    UNBOUNDED FOLLOWING - this SUMS to the end of the PARTITION
    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING - you can guess that this will add all of the items, which you will rarely use because if you omit the ROWS command then this range between first and last is actually the default
    Rather than ROWS BETWEEN you can also say RANGE BETWEEN, like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    I hope this little dissertation on running totals helps.
    Best wishes
    Michael

  • Using an expression in SSRS to display rolling 12 month and year to date volumes

    I need some help in writing an expression in SSRS. I have a table that contains date columns and rows that contain different types of data groups. (e.g. total number of items received during the month, total dollars for the month, etc.) I want to add two
    new columns to the end of the report that will display a rolling twelve month total for each of the different rows of data. Plus a column that would show year to date totals for the same rows.
    I was thinking I could accomplish this by adding expressions for each row in the new 'rolling twelve month' and 'YTD' columns in my report however, I'm not sure how to structure the expressions to achieve this.
    Here is an example of how my report currently looks. (I added a pipe delimeter in case the formatting changes once this is submitted.)
                             Jan-2014 | Feb-2014 | Mar-2014 | Apr-2014 | Rolling 12 mth | YTD
    Items received     100 | 35 | 45 | 12 | 192 | 192
    Dollars                $50.00 | $25.00 | $120.00 | $15.00 | $210.00 | $210.00
    Any guidance you can provide would be appreciated.
    Thank you  

    This example shows how to get what you need. It'll take modifying your query to add two cased columns onto the end.
    DECLARE @forumTable TABLE (periodYear INT, periodMonth INT, periodMonthName VARCHAR(12), periodDollars MONEY, periodItems INT)
    DECLARE @i INT = 0
    SET NOCOUNT ON
    WHILE @i < 24
    BEGIN
    INSERT INTO @forumTable (periodYear, periodMonth, periodMonthName, periodDollars, periodItems)
    VALUES (YEAR(DATEADD(MONTH,-@i,GETDATE())), Month(DATEADD(MONTH,-@i,GETDATE())), DATENAME(MONTH,DATEADD(MONTH,-@i,GETDATE())), 1000-@i, 100-@i)
    SET @i = @i+1
    END
    SET NOCOUNT OFF
    SELECT *,
    CASE WHEN CONVERT(VARCHAR,periodYear) + '-' + CONVERT(VARCHAR,periodMonth) + '-01' > DATEADD(MONTH,-12,GETDATE()) THEN periodItems ELSE 0 END AS ytdItems,
    CASE WHEN CONVERT(VARCHAR,periodYear) + '-' + CONVERT(VARCHAR,periodMonth) + '-01' > DATEADD(MONTH,-12,GETDATE()) THEN periodDollars ELSE 0 END AS ytdDollars
    FROM @forumTable

  • Calculating HTD(Half Year to date) in Essbase

    Hi All,
    Is there any way in essbase where in you can calculate HTD(half year to date) Values.
    I know in essbase we have Dynamic time series where in you can calculate YTD,HTD(History to date),MTD,QTD,...etc.
    can you guys have any thoughts on as how HTD(half year to date) is achievable in essbase.
    thanks in advance.

    Can you modify your time dimension to look like
    Time
    -1st Half
    ---Qtr1
    ------Jan
    ------Feb
    ------Mar
    ---Qtr2
    ------Apr
    ------May
    ------Jun
    -2nd Half
    ---Qtr3
    ------Jul
    ------Aug
    ------Sep
    ---Qtr4
    ------Oct
    ------Nov
    ------Dec
    If so, you could enable a dts member and set the alias to be hf-t-d
    if you can't add those members, condider adding a dynamic calc member with a formula
    psudo logic would be
    If it is a descendant of Q1 or Q2 then sum Jan to the current month else if it is a descendant of q3 or 4 sum jul to the current month

  • Year to date, rolling quarter measures

    I need to implement reports with year to date, rolling quarter (current month + 2 previous month) measures, etc...
    The BO universe is connected to a bex query on a SAP multi provider
    Where do you recommend to implement such measures?
    Should we precalculate them in a SAP BI keyfigure ?
    Should we create a restricted key figures in the bex query and using SAP variable with customer exits to implement for example the rolling quarter functionnality?
    Should be we create a new measure in the BO universe?
    Should we create a new variable in the report. In this case what is the impact on the performance?
    We have about 30.000 records in our cube for about 3 years of data. the volume will grow on a monthly basis but analysis will mainly be done on maximum three years of data.

    Hi,
    this is not related to performance. this is related to the simple fact that the MDX on SAP BW does not have support for something like a Today() or a Now(), which means you can't have rolling months based on the system date.
    if you use an EXIT variable you have the keyfigures in the universe and can leverage it in the Web Intelligence report.
    ingo

  • Loading year to date data

    Due to sourcing issues, it would be easier to load year to date and calculate month. All documentation shows month rolling up to year to date. Will year to date work?

    You can create your time dimension so that you load your YTD data into a 'YTD' member. You can then use a shared hierarchy to calculate your discrete months.E.g - Jan = "Jan YTD"Feb = "Feb YTD" - "Jan YTD"Mar = "Mar YTD" - "Feb YTD"etc.If Time is dense then these can easily be set to dynamic calcHope this helpsDave Cooper, Analitica Ltdwww.analitica.co.uk

  • Previous years plan data for single year.

    I have 7 plan data for each year. For example for 2017 I have following ..
    what is planned for 2017 in 2011.
    what is planned for 2017 in 2012
    what is planned for 2017 in 2013.
    what is planned for 2017 in 2014.
    what is planned for 2017 in 2015.
    what is planned for 2017 in 2016.
    what is planned for 2017 in 2017.
    Client wants to store all the previous years plan relating to each year.
    I already have various category for plan such as plan1, plan2, revised plan etc.
    How to handle the above scenario for 7 years plan data. Appreciate any inputs..

    Categories named against planned year can be created. A working category(PLAN) is used in all reports and input templates. whenever PLAN data is finalized PLAN can be copied to respective planned years category . ie in 2012 , when planned data is finalized, PLAN is copied to PLAN2012 .In 2013 , PLAN should be copied to PLAN2013.
    That way , planned amounts of 2017 can be retrieved from   respective planned year categories .
    Planned amount of 2017 in 2012 is cat:PLAN2012,Time:2017.total 
    Planned amount of 2017 in 2014 is cat:PLAN2014,Time:2017.total
    Hope this helps.

  • How do I calculate Year to Date?

    Dear Colleagues,
    I need to calculate Year to Date-revenue. Date is a prompt input, so the customer can choose which ever day he wants. How can I get revenue YTD based on the input? Is this a BODI assigment more than a BO assignment?
    Looking forward to give you some points!
    Regards Silje

    Hi Silje,
    Normally you would build objects like this in designer (oracle syntax):
    sum(case when tab.datecolumn
    between (@prompt('give ytd date','D',,mono,free)-to_number(to_char(@prompt('give ytd date','D',,mono,free),'ddd'))
    and @prompt('give ytd date','D',,mono,free) then tab.amountcolumn
    end)
    So basically sum all the amounts only if they are between the start of the year and the given date.
    You use simple date manipulation to get to the right when condition, it can be based of a prompted date,
    but also of the sysdate (current date).
    There are dozens of variants here, you can build
    year to date amounts (this year, last year, given year),
    period amounts (given period, current period, last full period),
    week amounts (current week, last week, last x weeks), full year amounts, etc.
    you get the idea...
    So get your wish list ready and talk to your designer...
    Hope this helps,
    Marianne
    P.S. should you wish to do it in the report, use a prompted date object in the query & select the date to compare in the query (note that you might get an awful lot of row back here)
    sum(<amount object> where (<date object> between <given date>-ToNumber(FormatDate(<given date>,"ddd")) and <given date>)

  • Displaying current year and previous year's data.

    hi all,
    we have fields like doc.no, company code, costcenter, posting date, year etc... in a query.
    we are using this query to display data in VC,
    how can i display the current year and previous year's data in two different tables using the available fields.
    any help will be highly appreciated.
    thanks,
    Rk

    Hi Rk,
    You can achieve your requirement using 'Filter' operator. Drag one 'Filter' operator into visual composer story board and drag the output into filter and add condition(Check year=2008) and drag one table from filter. For another table use another filter and change the condition.
    Hope it helps...
    Regards
    Basheer

  • SSRS expression for today,yesterday,Lastweek ,Last fortnight,Last Month, Year to date

    Hi All;
    I have a field called createdon 
    Using this field i need to create the SSRS expression for the table as below 
    Any help much appreciated
    Thanks
    Pradnya07

    use expressions as below
    assuming this is to be done in SSRS
    Today
    =COUNT(IIF(
    DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
    Yesterday
    =COUNT(IIF(
    DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
    LastWeek
    =COUNT(IIF(
    DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
    Last fortnight
    =COUNT(IIF(
    (DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1)
    Or (DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-2),Fields!YourRequiredField.Value,Nothing))
    Last Month
    =COUNT(IIF(DateDiff(DateInterval.Month,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Month,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
    Year To Date
    =COUNT(IIF(DateDiff(DateInterval.Year,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Year,Cdate("01/01/1900"),Now())
    And
    DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) <= DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to fetch year till date value for earning for current ,last and year

    hi,
    how to fetch year till date value for earning for current ,last and year before that from payroll result
    plz reply soon,
    pratyush

    Dear Pratyush,
    Pick this from CRT.
    Use LDB PNPCE & Fire event GET PAYROLL &
    then you can pick from CRT.
    Hope this helps.
    Kindly reward in case useful.
    Regards & Thanks,
    Darshan Mulmule

  • Table for Year to date payments made to vendors

    Hi friends,
    I am generating one query, in which I have to show year to date payments made to vendors.
    can anyone tell me from which table and from which foield can I get this information.
    Please help.

    hi,
    GO to SE16 and select doc type wise , you will get a solution .
    i hope it helps you.
    regds,
    raman

  • HT4818 hey, I want to install windows on my mac, I have mac osx lion and I'm soon going to get mountain lion. If I use Boot camp to install windows do I need a windows disc, will i lose all my data, etc. If so how to I save them. Can I switch back to osx

    hey, I want to install windows on my mac, I have mac osx lion and I'm soon going to get mountain lion. If I use Boot camp to install windows do I need a windows disc, will i lose all my data, etc. If so how to I save them. Can I switch back to osx after I install windows. ( can I switch between Windows and OS X as many times as I want.) thanks for answering.
    Sebastian

    hey, I want to install windows on my mac, I have mac osx lion and I'm soon going to get mountain lion. If I use Boot camp to install windows do I need a windows disc, will i lose all my data, etc. If so how to I save them. Can I switch back to osx after I install windows. ( can I switch between Windows and OS X as many times as I want.) thanks for answering.
    Sebastian

  • HT2513 On iCal this year the date of shrove tuseday is showing on Tuesday 13 of February witch for a start is wrong coz it's a Thursday and wrong because its meant to be in march

    On iCal this year the date of shrove tuseday is showing on Tuesday 13 of February witch for a start is wrong coz it's a Thursday and wrong because its meant to be in march

    kaeandcolesmon,
    If you open the recovery drive (partition) it should only have a single folder (Recovery).
    To make sure that your not saving restore points to that drive.
    See:
    Start, Control Panel, System, System Protection tab. Make sure the D drive partition is set to OFF so that it does not save there.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • Month to Date and Year to date calculation

    Hello Experts,
    It would be great If you could provide the formula to implement in BO universe or in the Reporting level for the below requirement.
    MTD, LastMonth, Year to Date, Last to LastMonth and examples are below.
    Last Week:
    Eg: Monday through Sunday
    Description: Based on Todayu2019s date, select the Monday of the previous week for the start date and Sunday will be the end date.
    Example:
    If Today is May 22, 2009
    The result would be, Monday = May 11, 2009, Sunday = May 17, 2009
    MTD:
    If Today is May 22, 2009
    I need a result MTD = May 1, 2009 u2013 May 21, 2009
    LastMonth:
    If Today is May 22, 2009
    I need a result LastMaont = April 1, 2009 u2013 April 30, 2009
    Last to LastMonth:
    If Today is May 22, 2009
    I need a result LastMaont = March 1, 2009 u2013 March 31, 2009
    Thank you.

    Nisniki,
    Here are the methods using WebI:
    MTD: 
    Create a local variable "MTD Start"
    =RelativeDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));1)
    Create a local variable "MTD End"
    =currentdate()
    LastMonth
    =LastDayOfMonth(RelativeDate(CurrentDate();-30))
    Year to Date
    create a local variable "YTD Begin"
    =ToDate("01/01/"+FormatNumber(Year(CurrentDate());"####");"mm/dd/yyyy")
    (reuse "MTD End" or build a "YTD End" variable same as "MTD End")
    Last to LastMonth
    (similiar to MTD, but using "60" versus "30" to move back two months versus moving back 1 month.
    To perform this stuff in the universe requires an understanding of the SQL syntax for the paricular vendor your are working with.  ANSI SQL agrees to represent and compute dates uniformly, however, the functions to make it happen varies by the vendor.
    Thanks,
    John

Maybe you are looking for

  • EPrint app OneDrive support

    Hello. I am trying to print from my iPad. I have connected my printer to the app, and have been able to connect to my Google Drive with no problem. Microsoft's OneDrive is not on the automated choices. Is there a way to add OneDrive to the app? I hav

  • Problems exporting video to AVI TYPE 1 format

    Hello I use the Final Cut Version ProHd for editing my videos but I'm having problems when exporting the final project. The file is exported in the .mov format but I need it exported as AVI type 1 since it is going to be played in a PC. If I export i

  • Issue With Business Objects Installation-STW00213 The Central Management Server has failed to start.

    Hi, I am in the process of installing Business Objects XI 3.1 in one of our server. While installing I am getting the error 'The Central Management Server has failed to start. Press 'retry' to attempt to start it again or 'cancel' to skip any actions

  • Manage Substitution Rules UWL

    Dear. I have the following doubt with the Manage Substitution Rules UWL : Is posible have a rule in where Only some WF should go to the inbox of the substitute? Ie. The Boss have process of Workfow of modules OM, TV, PA, PY that arrives at UWL, and t

  • OTL TIMECARD LOV Configuration

    Hi Guru's, I have a question on dependents LOV in TimeEntry Screen. Description: I have a LOV called AFE which shows all the AFE Codes and AFE Names from the table(this table has two columns in the database). And another LOV called RC which shows RC