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

Similar Messages

  • 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?

  • Need sql querry for records between Current Year First day and Current Day

    Hi,
    I have a table like this...
    Empid     Empname     DOJ
    TEST1     ERDDF     19-Jun-2011
    TEST2     AA     22-Mar-2011
    TEST3     SS     22-Oct-2011
    TEST4     VV     01-Jan-2012
    TEST5     HH     01-Apr-2012
    TEST6     AS     18-Jun-2012
    TEST7     ER     26-Jun-2012
    TEST8     ERDDF     28-Jun-2012
    My output like this...
    Empid     Empname     DOJ
    TEST4     VV     01-Jan-2012
    TEST5     HH     01-Apr-2012
    TEST6     AS     18-Jun-2012
    TEST7     ER     26-Jun-2012
    Logic:
    records between Current Year First day and Current Day(sysdate)

    937506 wrote:
    Hi,
    I have a table like this...
    Empid     Empname     DOJ
    TEST1     ERDDF     19-Jun-2011
    TEST2     AA     22-Mar-2011
    TEST3     SS     22-Oct-2011
    TEST4     VV     01-Jan-2012
    TEST5     HH     01-Apr-2012
    TEST6     AS     18-Jun-2012
    TEST7     ER     26-Jun-2012
    TEST8     ERDDF     28-Jun-2012
    My output like this...
    Empid     Empname     DOJ
    TEST4     VV     01-Jan-2012
    TEST5     HH     01-Apr-2012
    TEST6     AS     18-Jun-2012
    TEST7     ER     26-Jun-2012
    Logic:
    records between Current Year First day and Current Day(sysdate)Probably you are looking for :
    where DOJ between trunc(sysdate,'YYYY') and sysdateRead {message:id=9360002} and always provide details mentioned in this thread.

  • Default Date parameter to current date

    Using Crystal Reports 2008 version 12.1.0.892
    I have a Stored Procedure for the report that among others requires a StartDate and EndDate parameter.
    It appears that I can not easily/simply set the default for this parameters to the current date.
    In the properties dialog for the parameter the Default value appears to be just a text field.  I can type in a value, but I can not make it always have the current date selected.
    This report also has an End Date that we would like to have default to the current date(no time) plus one day.
    We can do this using Reporting services, but I can not find a way to do this as easily in crystal reports. What am I missing?
    Thanks

    Well here's a little quick tip for reports have to be scheduled and require date parameters. I've used this on lots of reports...
    For the bulk of our scheduled reports, the user typically wants to see data for either the current month or the previous month. For example management may want a production report scheduled to run at the end of every week for the current month so that they can track month to date progress. They will also want the same report run on the 1st of the month for the previous month so that they have a final monthly total.
    Here's how I do it with just one report...
    1) Create a text parameter called {?DateRange}
    2) Give it 2 static LOVs... Current Month & Previous Month
    3) Build out the SQL Command (I use a lot of them... Most of our vendors aren't nutty about clients adding SPs to their DBs)
    4) Drop in the following block of code at the top of the SQL Command...
    DECLARE @DateRange CHAR(15)
    DECLARE @BEG DateTime, @END DateTime
    SET @DateRange = '{?DateRange}';
    IF @DateRange = 'Current Month' SET @BEG = DATEADD(mm, DATEDIFF(mm,0,GETDATE()),0)
                                                   ELSE SET @BEG = DATEADD(mm, DATEDIFF(mm,0,GETDATE())-1,0);
    IF @DateRange = 'Current Month' SET @END = DATEADD(ms,-5,DATEADD(mm, DATEDIFF(mm,0,GETDATE())+1, 0))
                                                   ELSE SET @END = DATEADD(ms,-5,DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0));
    5) Modify the WHERE clause of the SQL to pull dates between @BEG AND @END
    6) Add the DateRange parameter in the Parameter List of the Command.
    At this point the user has just 2 date range options... Current Month & Previous Month.
    From there you can upload to the CR Server and schedule it.
    Jason

  • Getting Start and End Date of Current Year?

    Hi Folks,
    How do I get the start of the year and end of the year in Java ?
    If I say :
    Calendar cal = Calendar.getInstance();
    int day = cal.get(Calendar.DATE);
    int month = cal.get(Calendar.MONTH);
    int year = cal.get(Calendar.YEAR);
    System.out.println("Day: " + day);
    System.out.println("Month: " + month);
    System.out.println("Year: " + year);
    I get the current day and time.What I need is the start of the current Year (Jan 2010) and the End of the Current Year (Dec 2010).
    How can get the above 2 dates if I the current date is March 24th 2010 ?
    Thanks

    sabre150 wrote:
    What am I missing? The start date of 2010 is 1/1/2010 and the end data is 31/12/2010 . So, as I see it, at any time the only information you need is the current year which you currently get from int year = cal.get(Calendar.YEAR);
    Well, with the GregorianCalendar, anyway. ;-)

  • How to set as default current year & period in variant

    Hi SAP Guru,
    Can anyone help me on how to set as default the current year and period in variant.  I want to do a background job for our program using save variants.  But I need the period and year to always be assigned what ever is the current year and period.
    Hope someone can help.
    Thanks
    Daboi

    - Create variables for variants: use transaction STVARV. You should create one variable for fiscal year with type 'parameter', one for period with type 'parameter', one for fiscal year 'select option' and one for period 'select option'.
    - when saving your variants for the different programs, fill the checkbox 'Selection variables' in the attributes for fiscal year and period; use the button 'selection variables' for choosing the variables created in STVARV.
    - When closing the period, you should use STVARV for changing the variables. All the variant using the variant variables will then automaticaly use the new value.

  • Dynamic default for parameter

    Hi
    Is it possible to have a default for report parameter that depending on the date.
    For instance our customers need now to enter a Begin and Start date to display their data for a particular range.
    Wish: When the parameter screen pops up the Start date and the End date are already filled in by default. In the start parameter i want the monday of 1st week of the year. In the end parameter i want the friday of the current week.
    Is this possible? Need the date range parameter be of type date, or is String also allowed?
    Thanks in advance
    Auke Quist.

    Hi Auke,
    To give parameter default values, we will have two methods, this is either enter values directly or pickup the values from a database field.  As per your requirement, we can't define default values to start and end paramenters.
    If you are using CR2008 then you have an optional parameter option, using this option we can check with Hasvalue() function whether the user entered values or not.
    In your case we can write a formula if Hasvalues(ParameterValues) is empty then assign first week of the year to start and last week friday to end parameters in recored selection and filter the data.
    Please note that att any point of time you can't assign formula results to your parameter default values.
    Thanks,
    Sastry

  • Default Data Parameter

    Post Author: despec
    CA Forum: General
    I have read that in previous CR version (before XI), you could default a date parameter to the current date.  Is there any way in CR XI to achieve this or our we SOL until we upgrade to CR 2008 (which I hear does allow date parameter defaults)?David

    Hi,
    It depends which version of Discoverer you are using. Search the Discoverer forum (http://forums.oracle.com/forums/search.jspa?objID=f56&q=SYSDATE+parameter) or check these links (Default parameter value to sysdate Default a parameter value to sysdate for possible solutions.
    Rod West

  • Do I need to check "READONLY" parameter in BBP_SC_AUTO_RETRANSFER report?

    Hi Gurús,
    I applied SAP Note 1499352 - SRM Transfer: Redesign, bug fixes (and all its correction notes).
    The new BBP_SC_AUTO_RETRANSFER report is needed to scheduled with a job.
    The report has three parameters:
    ADD_TIME (Hours since last "changed at") - default value 48
    ADDTIME2 (Timeout hours) - default value 24
    READONLY (Read only, no Updates) - checked by default
    But I don't know if READONLY must be checked in job scheduled.
    My system is:
    Component software: SRM_SERVER
    Release: 700
    Level: 8
    Support package: SAPKIBKV08
    I'm using extended classic scenario.
    Do I need to check "READONLY" parameter in BBP_SC_AUTO_RETRANSFER report?
    Thanks in advance,
    Alonso Valenzuela

    The parameter was unchecked to save changes in database.

  • FSG - Need to find beginning balance value from current year

    Hi,
    Could any one help me please,
    i designed FSG report and the issue is we need to find the beginning balance form the current year
    and i do not know which amount type i should use in column set.
    maybe there is any way or workaround for this issue?
    example :
    when i run the report with parameter JUN-12, the XXX (beginning balance current year) = 5000
    and when i run the report with parameter SEP-12, the XXX (beginning balance current year) is still 5000
    thanks
    Lim Johny

    This is some of the worst SQL I have seen. The data element names change from table to table, and they violate ISO-11179 rules. We seldom use OUTER JOINs in a properly designed schema, we seldom need to worry about NULLs; we use COALESCE(), not ISNULL();
    we use CURRENT_TIMESTAMP, not getdate(), etc. 
    Did you know that nesting scalar subqueries will screw any hope of optimization? The changes in the formatting of program text implies that many different, inexperienced younger programmers who wrote in many different non-SQL languages. You even posted in colors,
    like grade school! 
    My guess is that everyone wrote a query without any planning, and then threw them together in one pile. 
    It seems that this nightmare has three tables and we have no DDL or other specs:
     Stock 
     Stock_Lead_Times 
     Traces
    Want to follow Netiquette and post DDL with some specs? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • SSRS Matrix report. Variance expression by Month. Need to compare month from prior year to current month of current year VS2010

    Please help.  I have a matrix report.  In the report I have row group  PO Type.  One the Column groups I have a parent group by Fiscal Year, and then a child group by Month.  When I run the report, I get two years of data back broken
    out by month.  Please see below.
    Now here is where I am getting stuck.  I need to take the variance between the current month of the current year, from the same month of the prior year.  So I need to show the difference between Oct , 2014 from Oct, 2013. November, 2014 from November
    2013... etc. etc.
    In the example below, how do I create a column or row showing the variance for Contracts for October 2014.  I need to take the contracts for October 2014 which is 3 and subtract that from October 2013 which is 8.  Any suggestions? How do I do that
    for each month?  Then I need to do it for the quarter... then the year?  But I'll be happy if I can just get the month working first.
    Any help will be appreciated. 
    here is what my rdl file looks like.
    Here is what my report looks like when I render it.

    Hi Adrian_s2012,
    According to your description, you want to compare values for the month of current year with the month of prior year and get the variance. Right?
    In Reporting Services, we don't have any function to get this "Year to Year" Growth. In this scenario, if you data source is a cube, we suggest you use Analysis Services to achieve your requirement. If this data source is just from database, it will be hardly
    to calculate the variance because we need to compare the values within every two different column group and matrix generate adjacent columns one by one. Even we make it by using custom, every time executing the long code when generating result
    in a cell will reduce a lot of performance, we really don't suggest to do that in SSRS. Here is a thread with much easier requirement, please take a reference of that:
    http://social.msdn.microsoft.com/Forums/office/en-US/842e2dcb-d949-4297-9d91-eac989692cb5/difference-between-the-grouped-column?forum=sqlreportingservices
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • 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)

  • Trying to install iCloud on Win7 get error message either no default mail client or current mail client cannot fulfill messaging request.   How fix?

    Trying to install iCloud on Win7 get error message either no default mail client or current mail client cannot fulfill messaging request.   How fix?

    Outlook 2013.  Under Start Up Options, I have checked "Make Outlook the default program for E-mail, Contacts, and Calendar".

  • My husband's iphone has a hotmail ID but it was hacked and we need to change it to his current email. Where do we change it? I tried on apple and it says he has a yahoo address?  We want to download apps on his phone and can't because of the hotmailThanks

    My husband's iphone has a hotmail ID but it was hacked and we need to change it to his current email. Where do we change it? I tried on apple and it says he has a yahoo address?  His yahoo mail comes to his phone. We want to download apps on his phone and can't because of the hotmail address.
    Thanks

    My husband's iphone has a hotmail ID but it was hacked and we need to change it to his current email. Where do we change it? I tried on apple and it says he has a yahoo address?  His yahoo mail comes to his phone. We want to download apps on his phone and can't because of the hotmail address.
    Thanks

  • How to set current year,month as default value in combo box

    hi,  im newbie of xcelsius user
    i realize  that hv a issue that display combo box base on year & month
    let said
    <b><u>step 1</u></b>
    I create excel data like this
    <b><u>year___ </u>  </b>    |     <u><b>month_   </b></u> |     <u><b>Product</b></u> |     <u><b>revenue</b></u>
    02-04-09 |     02-04-09 |       a |     $4,154
    03-04-09 |     03-04-09 |       b |     $6,813
    04-05-09 |     04-05-09 |       a |     $9,875
    05-06-09 |     05-06-09 |       b |     $6,813
    06-04-10 |     06-04-10 |       a |     $6,813
    07-04-10 |     07-04-10 |       b |     $9,875
    08-06-10 |     08-06-10 |       a |     $9,875
    22-06-10 |     22-06-10 |       b |     $6,813
    <u><b>Step2</b></u>
    Then i go format cell to format/custom date to year & month
    Eg1: Year u2013>  02-04-09  convert to u2018YYYYu2019 (2009)
    Eg2: Month u2013>  02-04-09  convert to u2018mmmmu2019 (April)
    So output like this
    <u><b>year</b></u> |     <u><b>month</b></u> |     <u><b>Product</b></u> |     <u><b>revenue </b></u>
    2009 |     April |     a |     $4,154
    2009 |     April |     b |     $6,813
    2009 |     May |     a |     $9,875
    2009 |     June |     b |     $6,813
    2010 |     April |     a |     $6,813
    2010 |     April |     b |      $9,875
    2010 |     June |     a |     $9,875
    2010 |     June |     b |     $6,813
    But the problem is when i insert to combo box,use u201Cfilter Row u201D, i excpectation will display only 2009,2010
    But Actual display the Year  in combo box is duplicated :'(
    so any solution ? and then only how to set current year & month as default value  :'(
    thanks,
    regards
    s1
    Edited by: Leong Pui Kee on Feb 25, 2011 5:25 AM
    Edited by: Leong Pui Kee on Feb 25, 2011 5:36 AM

    hi,
    your created  data
    step 1
    I create excel data like this
    year___ | month_ | Product | revenue
    02-04-09 | 02-04-09 | a | $4,154
    03-04-09 | 03-04-09 | b | $6,813
    04-05-09 | 04-05-09 | a | $9,875
    05-06-09 | 05-06-09 | b | $6,813
    06-04-10 | 06-04-10 | a | $6,813
    07-04-10 | 07-04-10 | b | $9,875
    08-06-10 | 08-06-10 | a | $9,875
    22-06-10 | 22-06-10 | b | $6,813
    In this, year and month both are same data, make the diffent data like year  2009, 2010  And month Jan, Feb, March, ...Etc 
    and also one more check you formulas on month and year, select correct source data, destination data  for compoonent..
    OR
    from above, to create a date column and convert  date-->year, date--> month and Explore it.
    All the best,
    Praveen

Maybe you are looking for

  • Original item cannot be found?

    I have sent several videos from my phone to my computer via email. I saved the videos to a folder on my desktop. Originally all the videos played. However, now I am getting an error message on about half of them which states: "The alias 'blah blah' c

  • Sync iPhone Contacts to Address Book on iMac

    Is it possible to sync or to export iPhone (G3) "Contacts" to "Address Book" on an iMac? ...or will the sync process in iTunes move information form the iMac to the iPhone?

  • I upgraded my ipad to iOS 5.1.  However, my Youtube favorites are missing.  These are favorites saved on the iPad, not on the youtube account.

    I upgraded my iPad to iOS 5.1.  Afterwards, my Youtube favorites are missing.  These are favorites saved on the iPad and not linked to a Youtube account. I have tried restarting the iPad several times to no avail.  The favorites seems to be still on

  • Deploying from JDeveloper 10.1.3 to Oracle AS 10.1.2

    Hi! I use JDeveloper 10.1.3 and Oracle Application Server 10.1.2. When I want to deploy my application (TopLink + EJB Session Bean Facade + ADF Faces) from JDeveloper to Application Server an error occured: ---- Deployment started. ---- 16.05.2006 14

  • Bridge CC freezes

    Since a few days I experience the following problem: When I try to open a folder in Bridge CC which contains GIF images, it freezes. After removing the GIF file from the folder with Explorer the folder opens in Bridge without a problem and the progra