Parameter for current year and previous year

Hi all,
I currently have 2 reports where the query is the same except in the where clause I have it filtered to current year and previous year based on the List_Date. I would like to make this one report with a parameter of Current or Previous year.
Would I create 2 more datasets one for current and another for previous? I would think there is a easier way. Any help or direction would be great.  

If you define a parameter in SSRS, you can use it's value in your query. Just make sure the parameter name, and CASE (SSRS is case sensitive when it comes to parameters) are the same in SSRS and your query. There's a parameter tab on the dataset properties.
It SHOULD auto fill, but it never hurts to check, just in case.
Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.
Yes it did auto fill the parameter tab in the dataset and I get a parameter to enter the year when I preview the report. Still a little confused on how I do current or previous year. Are the next steps what I need to do?
@yearParam parameter:
1) Create  Available or Default values 
2) Current and Previous year as label
3) For Value do I need to use a expression for current year =Year(now()) and previous Year?
4) Add a filter on the tablix for list_date?

Similar Messages

  • Parameter for Current Month and Previous Month

    I'm trying to create a parameter for current month and previous month based on the ex_date, but not sure what i'm doing wrong. 
    where ex_date = @SelectDate
    I created a second dataset below for the values in the parameters.
    SELECT Month(CURRENT_TIMESTAMP) AS 'Month', 'Current Month' as 'Current Month'
    union all
    SELECT Month(CURRENT_TIMESTAMP)-1 AS Month, 'Previous Month' as 'Previous Month'
    Results
    Month Current Month
    3 Current Month
    2 Previous Month
    Once I preview it I get "Conversion failed when converting date and/ or time from character string" I changed the data type to "date/Time" but that did not make a difference. The date is convert (varchar(10), ex_date, 101) so looks like
    11/12/2014. 
    I've also tried expressions like =month(now()) to pull current month with same error so i'm not sure what i'm doing wrong. Any ideas?

    i tired this real simple report
     in the first dataset - my main report query - select name from sysdatabases where month(crdate())=@month
    in the second dataset - select month(getdate()) as Month1
    in the parameters - choose int data type and available values - select the second data set
    in the first data set- add this parameter..( i am assumming you know this, since you have done)
    in the preview you should get the drop down with current month number - 3
    and if you run the report, it will display the database names that were created in march. remember we are no checking year, so will get all that were created in march across the years.
    Hope it Helps!!
    I'm looking to have the dropdown say "Previous Month" and "Current Month" as a option. I know how to get the information in SQL, but not sure how this translates or put into a parameter.
    Current Month
    list_date BETWEEN
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
    AND
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
    Previous Month
    list_date between
    CONVERT(varchar,dateadd(d,-(day(dateadd(m,-1,getdate()-2))),dateadd(m,-1,getdate()-1)),106) /* Last Month */
    and
    CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106)

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone,
    I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
    Thanks in Advance,
    G S Ramanjaneyulu.

    Hi krishna,
    Thanks for your quick reply, can you have a look at my code,
    case i_vnam.
    WHEN 'ZPWK_CWK'.
    ranges : pre_week for sy-datum.
    data : start_date type DATS,
           end_date TYPE dats .
    ************FM TO GET FIRST DATE OF CURRENT WEEK ************************
    CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
      EXPORTING
        DATE_IN  = sy-datum
      IMPORTING
        DATE_OUT = start_date.   " WEEK FIRST DATE
    end_date = START_DATE + 6.   " WEEK LAST DATE
    END_DATE   = START_DATE - 1.   " PREVIOUS WEEK END DATE
    START_DATE = START_DATE - 7.   " PREVIOUS WEEK START  DATE
    **********PREVIOUS WEEK DATES IN PRE_WEEK******************
    pre_week-SIGN   = 'I'.
    pre_week-option = 'BT'.
    pre_week-LOW    = START_DATE.
    pre_week-HIGH   = END_DATE.
    APPEND  pre_week.
    CLEAR : START_DATE,END_DATE.
    endcase.
    Regards,
    G S Ramanjaneyulu.

  • Balance sheet required for current quarter and previous quarter

    Hi Guys,
                 I am using 0FIGL_C10 cube for balance sheet report,i need to create balances for current quarter and previous quarter.
    user will enter the fisper, based on fisper it has to show the current quarter and previous quarter balance.
    how to calculate the quarter using fisper.

    you can use offset with ranges.
    or
    just offset of -1 , -2 & -3 seperately in 3 selections and add it in one column in formula (this will give u current quarter).
    similarly offset of -4, -5 , -6 will give u previous quarter result.
    total of 6 selection and 2 formulas. hide all selections from display.

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

  • 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

  • I need to default a parameter to current year in Bi publisher

    Hi,
    I have a requirement where i need to default the value of a parameter to current year. i see a sysdate() for current date i am looking for something similar.
    Thanks
    Vijay

    Yes, you can; please look at this example
    You can play around with these functions to add/subtract date/month/year
    To extract day or month or year- use Date format string dd for day, MM for month and yyyy for year

  • Use FI Posting date as a filter value, can I get YTD for current year?

    Dear Expert,
    I work on a BI report which calculate the YTD key figure (restricted by 0CYEAR and =< 0CMONTH).
    One of the requirement for the report is to allow user to enter a value for a date using FI Posting date (although this is optional).
    Without entering the value for FI Posting date, my report works fine.
    But once FI Posting date is entered, no data found.
    I expect that when the value for the FI Posting date is entered, the YTD value will be calcuated starting from the Jan 1 of that FI Posting year to the FI Posting date entered.
    But this seems not happen.
    Could you help me to resolve this problem?
    If there is a better solution, please let me know.
    Very appreciated.
    Arthur

    Hi Dipika,
    Thanks for your reply.
    In my report, FI Posting date is a free characteristic, which user can optionally select it and fiter it for a specific FI Posting Date. Do you consider it as a global filter?
    my query structure is as below:
    rows: profit center, department, manager
    columns: YTD for current year, YTD for Previous year, the difference betwwen the two
    The requirement is when user enter a FI Posting date, use it  to restrict the KF shown above.
    For example, if the FI posting date is March 15, 2008, then YTD for current year should be restricted by the period between Jan 1, 2008 and March 15, 2008 and YTD for previous year should be restricted by Jan 1, 2007 and March 15, 2007.
    Do you have any idea how to implement this requirement in term of FI Posting date?
    Thanks and appreciated.
    Arthur

  • Filter measure column for current year

    Hi,
    I'm stuck up with issue, we have a report from three tables D1, D2 and F1. In which D1 is time dimension. Now we have report from D2 and F1 with measures, and the report is placed in Dashboard which is having year prompt.
    F1 is joined with D2 and D1 Time dimension as well, the requirement is in the report one of the measure column say X should always show the values for current year, while others will show according to prompt values.. In short I want to display one of the measure column for current year, even though the user selects the prompt value for year earlier to it the values should not change.
    Please let me know, how to achieve this.
    Thanks in advance

    I think you can still solve this.
    Whatever Srini said keep it.
    Now for the date prompt create a presentation variable.
    pass this presentation variable in the expression for measure which you don't want the current year.
    case d1.year=@{presentationvarialbe} then sum(f1.x) else 0 end
    you can also use the filter expression too.
    remove year prompt filter from the report. and then add a new filter for the measure as<>0.

  • COPA Report current period and previous period issue

    Hi Gurus,
    I have defined COPA report (Tcode KE94) based on line items. Now I want all values to be displayed based on an entry parameter in terms of period. That is to say that  If I give input values of "010.2013" as a period entry , my report should display the values for the the period specified i.e. 010.2013 in the first column and in second column  values for the period 009.2013 should be displayed and in the third column values for the period 001.2013 till 010.2013 should be displayed cumulatively.
    For this, I choosed the character "period/year" in General data selection tab, clicked "Variable on/off" tab and gave values "From"  as well as "To" for the Global Variable "OFP"  which is Curr.fisc.per./year.
    For the 1st column (1st column which is suppose to display the values according to selection parameter), along with the character "company code" , I choosed the character "period" and clicked "Variable on/off" tab and gave value "From"  as well as "To" for the Global Variable "OFP"  which is Curr.fisc.per./year.
    For the 2nd column (2nd column which is suppose to display the values for the immediately preceeding period of the selection parameter), along with the character "company code" , I choosed the character "period" and clicked "Variable on/off" tab and gave value "From"  as well as "To" for the Global Variable "OFP"  which is Curr.fisc.per./year. While doing so, I selected operator as "-" and choosed offset as 1.
    For the 3rd column (3rd column which is suppose to display the cumulative values from the beginning of the fiscal year till the period mentioned in the selection parameter), along with the character "company code" , I choosed the character "period" and selected 001 in "From" and 016 in "To" tab.
    Company Code selected in all the three columns is same and I have selected actual values i.e. 0 for "plan/actual indicator" tab.
    When I run the report through Tcode KE30 , I give values as "010.2013" for the From and To selection tabs. System shows the values as per the selection parameter in the 1st column which is correct  but display values same as per coulmn 1st in the 3rd column which is wrong because it should be cumulative. 2nd column is blank. 
    How to display the values for the immediately preceeding period and for cumulative period?
    Regards,
    makrand

    Dear Ajay,
    Thanks for the reply. Here are the screen shots.
    For the general data selection tab
    For the first column "current month" i.e. for the month
    For the second column "Last Months"
    For the third column "Cumulative" i.e. year to date
    Following is the result of KE30
    Values for the period 010.2013
    You can see that values in the report for the period 011.2013 contains value for the previous period which is 59090.21
    This value is matching when the report is run for the period 010.2013.
    But in both the reports,the figures for Current month and YTD (year to date) are same.
    Please let me know what setting is required in the current month column.
    Regards,
    makrand

  • Display Current Quarter and Previous Quarter???

    Hi Gurus,
    I Had a requirement to display only the current Quarter and previous quarter in the report level using single quarter column.
    and my quarter value type is Q1 2013.
    Please anyone help me out on this asap/
    Thanks.

    Hi,
    Using time serious function you can acheive this requirement.
    http://obieetutorialguide.blogspot.in/2012/02/modeling-time-series-function-in-obiee.html
    OBIEE 11g Time Series Function
    or,
    Using presentation variable you can achieve this.
    Re: OBIEE 10g LY YTD returns YTD for past years
    The above thread for year you can change to qtr.
    Hope this help's
    Thanks,
    Satya

  • Difference between current row and previous row in a table

    Hi All,
    I am having a problem with the query. Can some of please help me?
    I need to get difference between current row and previous row in a table. I have a table, which have data like bellow.
    TABLEX
    ================
    Name Date Items
    AAA 01-SEP-09 100
    BBB 02-SEP-09 101
    CCC 03-SEP-09 200
    DDD 04-SEP-09 200
    EEE 05-SEP-09 400
    Now I need to get output like bellow...
    Name Date Items Diff-Items
    AAA 01-SEP-09 100 0
    BBB 02-SEP-09 101 1
    CCC 03-SEP-09 200 99
    DDD 04-SEP-09 200 0
    EEE 05-SEP-09 400 200
    Can some one help me to write a query to get above results?
    Please let me know if you need more information.
    Thanks a lot in advance.
    We are using Oracle10G(10.2.0.1.0).
    Thanks
    Asif

         , nvl (items - lag (items) over (order by dt), 0)like in
    SQL> with test as
      2  (
      3  select 'AAA' name, to_date('01-SEP-09', 'dd-MON-rr') dt,  100 items from dual union all
      4  select 'BBB' name, to_date('02-SEP-09', 'dd-MON-rr') dt,  101 items from dual union all
      5  select 'CCC' name, to_date('03-SEP-09', 'dd-MON-rr') dt,  200 items from dual union all
      6  select 'DDD' name, to_date('04-SEP-09', 'dd-MON-rr') dt,  200 items from dual union all
      7  select 'EEE' name, to_date('05-SEP-09', 'dd-MON-rr') dt,  400 items from dual
      8  )
      9  select name
    10       , dt
    11       , items
    12       , nvl (items - lag (items) over (order by dt), 0)
    13    from test
    14  ;
    NAM DT             ITEMS NVL(ITEMS-LAG(ITEMS)OVER(ORDERBYDT),0)
    AAA 01-SEP-09        100                                      0
    BBB 02-SEP-09        101                                      1
    CCC 03-SEP-09        200                                     99
    DDD 04-SEP-09        200                                      0
    EEE 05-SEP-09        400                                    200
    SQL>

  • General ledger does not match profit and loss for current year

    Closed 2008 and it created some unexpected journal entries. These JEs show up as beginning balances in the 2009 GL. Also net income does not match profit for current period on balance sheet. Tried reversing the unexpected journal entries and this caused the 2009 retained earnings to be more out of balance. How do I fix this?

    As far i understand you have done Balance Carry Forward by FAGLGVTR.
    and your opening balance in next year is not correct as desire in Retain earning account.
    If the case so then kindly check that you have transfer amount from retain earning account to and reserve account in previous year.
    Regards
    Shayam

  • Time Dimension _ Report on Current month and previous year.TOTAL

    Hi,
    My Time dimension is as under .
    July2013, Aug2013 ,......Jan2014,,,. June2014  = 2014.TOTAL
    My requirement is to report based on context view along with previous period total (.TOTAL) values.
    For example :      If i am using CV as : 2013.JUL my report should show 2013.JUL & 2013.TOTAL
                                If i am using CV as : 2014.JUN my report should show 2014.JUN & 2013.TOTAL
    Can anyone provide some direction to build the above scenario
    Regards
    Krishna

    Hi,
    do you have the property YEAR in your time dimension filled out? If so, you could use EPMDIMENSIONOVERRIDE function together with an Excel cell.
    Let me build an example:
    Assuming your report has two columns, one for the current month and one for the total year. I would split this into two, one report per month, i.e. column. The first report will show the current period, the second the total. Somewhere in the header of your sheet use:
    EPMDimensionOverride("001";"TIME";EPMMemberProperty(;EPMContextMember(;"TIME");"YEAR")&".TOTAL")
    001 is the default ID of the second report.
    BR,
    Arnold

  • MI31, Include Previous Inventoried batches Flag, WHY only for current year

    Hello All,
    We are using MI31 to generate Physical Inventory documents and our need is to always generate PI for batches having Stock but Not to Generate PI for Batches which have Stock 0 and are already counted(posted) atleast Once.
    Means if a batch has 0 stock today, we did an inventory count now and post successfully, Now for future we DON'T WANT TO COUNT THIS BATCH ANYMORE.
    We though of achieving this by running MI31 two times, once for batches with non-zero stock and second time for batches with zero stock.
    So, first time, with Flags "Only Mat without zero stock" and "Incl Batches subj to PhyInv", so that everytime PI is created.
    Second time, with Flag "Only Mat with zero stock" and WITHOUT marking flag "Incl Batches subj to PhyInv", so that a new PI doc is created only if there is no doc created earlier for this batch. This is working well but only wrt to CURRENT YEAR. If there is a PI doc for this batch which is processed last year, then again a new doc is created if I run this year which is NOT NEEDED.
    Is there any other customisation/setting/way to avoid these extra documents ?? We don't want to print PI this year for batches with zero stock which are already processed in 2010 (or earlier) and want to ignore them permanently.
    I hope I am clear in my query.
    Regards,
    Diwakar

    Thanks for the reply Jurgen.
    Yes, Archiving is one option but not sure would be agreed, I will discuss the pros n cons for it.
    if you dont want to count zero stock batches, then click the button "Acc.to Stock " in the middle of the selection screen and activate the box for only material without zero stock
    This will NOT ensure that 0 stock batches are counted at least ONCE which is the requirement. Therefore I am thinking for running them separately.
    Anyhow, it means there is NO solution to IGNORE 0 qty batches which are already counted atleast Once (in previous years)  :(
    Can you think of any other workaround to achieve the same (other than archiving) ?
    I guess we can mark them deleted and then play with the deletion flag indicator in this program.

Maybe you are looking for

  • Deleting songs from itunes Library and syncing

    I have loaded up my nano with most of my personal cd's and some purchased songs. I'd like to delete most of the songs off of the itunes library (sorta seems like double kill since they are on my nano and computer)...I really only need them in one spo

  • Problem (sort of) deleting photos from external hard disk.

    Hi. (Most likely) because of moving my photos from the C:/drive to an external HD, I get the following message whenever I try to delete photos "the files are on a volume that does not support the recycle bin lightroom. Would you like to delete them i

  • 3G spin/touch/scroll wheel not working

    after about 3 times of restoring this iPod, it has yet to fix anything that's wrong with my wheel. it stopped working yesterday when I tried to update it manually. the other buttons work but this still doesn't allow me to search for artists, playlist

  • PeopleTools 8.49.22 with Oracle 11gR2

    Hello. We have an installation of peoplesoft using peopletools 8.49.22 with Oracle 10.2.0.4.0 on Solaris 10 Recenlty the DBAs are migrating the databases to Oracle 11.2.0.3.0. Our demo database was upgraded and they installed the Oracle Client 11.2.0

  • Oracle AS / RHEL 4

    Our school is having some issues with installation of Oracle AS, in particular, 10g, I believe, with the installer having troubles apparently when the install script calls the packages, in particular, with the discoverer module installation. Has anyo