Create current date variable at universe level

   Hi Everyone
I have created report regarding to daily car sales. However there is records registered for further months, 2015 December for instance.
Actually they are error records, but I can't delete them since data transfer is realizing automatically and updates hourly.
That is why I have decided to use prompt for report: date is less or equal to current date. But couldn't find way how to create current date variable.
Please help with this.
Regards...

Yes.
Create an object called Today as:
cast(convert(char(10),getdate(),23) as datetime)
Note that it will not parse because it does not reference a table. Don't associate it with a table just to get it parsing as you will then have that table in every query that uses the Today object, whether you want it or not!
It will work fine when you use it in your query. In your example, create a condition of Ship Date Less Than Or Equal To Today where Ship Date and Today are the names of the two objects. This will then translate into SQL as:
WHERE orders.ship_date <= cast(convert(char(10),getdate(),23) as datetime)
This will parse because the table orders is in the statement.
I hope that is clear.
Regards,
Mark

Similar Messages

  • How to create Current Year Filter at Universe Level ?

    Hi,
    I want to create a Current Year, Next Year and Last Year filters at Universe Level.
    Can anyone help me with this.
    I am using Netezza database and not able to find the appropriate date function in Netezza to accomplish this.
    Any suggestions ?
    Thanks

    Hi,
    You would somehow need to extract the Year part from the system date..
    then
    Current Year = Year
    Next Year would be i.e Current Year + 1
    Last Year would be i.e Current Year - 1
    I guess this is the simple part... but you would need to find those functions on your RDBMS..
    Hope this helps
    Jacques

  • Current Date in Olap Universe basead in Bex Query

    Hi All!
    I'm having some problems as the current date in the universe.
    I need the report that runs in background and a filter has the current date, I mean current month and year. The universe is based on a query Bex, and the query have a variable with the current month and year.
    I canu2019t filter int the query because it always bring the current month, and a only need that for a few reports, the others it gonna be filter by date choosen by the user.
    To resolve this I made this filter:
    <FILTER KEY="[0CALMONTH].[LEVEL01]">
    <CONDITION OPERATORCONDITION="Equal">
    <CONSTANT CAPTION ="Dec 2010"/>
    </CONDITION>
    </FILTER>
    And to my surprise it worked!
    I wonder if there is any way to make a filter with the current date dynamic?
    I tried in the constant caption : "[0CALMONTH].CurrentMember" or "[0CALMONTH].DefaultMember", but didnu2019t work, the query returns blank. Is there any way to do this? Is there any variable that the BW understand that I want the current month and year?
    Tks a lot!
    Livia

    Sorry! I didn't see that, but i already posted in the right forum.
    In the Universe.
    But it could be done with a filter in web i report also.
    Any ideas?
    Tks!
    Livia

  • Controlling data access at universe level

    Hi,
    I had a doubt in universe regarding the implementation of security.
    Existing process: We had a portal called flex (intranet site)which the BO report has been integrated and  for opening the report the name of report was clicked (hyperlink) 
    This report should show the data specific to the user profile logged into the portal.
    Now if we want to restrict the data at universe level for each individual users accessing the report in portal our idea is to create a dervied table (which contains a list of userid's and project id's)in universe so that who ever logged into the portal and clicks on report he will see the data only related to profile
    For example: The scenario would be a manager residing in a region need to see the list of projects which he is assigned to but not all of them.
    Could you please let me know how can implement at universe. Kindly let me know if you need any futher information.
    Thanks,
    Eswar

    Another way to do this is: (a) in your universe create a table that has a list of user names a long with their BOUSER id; (b) associate that list with fact tables or d imensions in the database, either using joins or by using a where clause as a filter or in an object definition using the syntax @variable(bouser); below is an exerpt from BO Designer guide.
    Example:
    @Variable
    In the universe for a human resources database, you have an object called
    Employee name. You want to restrict the returned data for Employee name
    to the values authorized in the database for each user. This would allow
    you to control what employee information each user is allowed to see. This
    information is defined by their database profile.
    You insert the @Variable function in the WHERE clause as follows:
    Employees.Employee_Name = @Variable('BOUSER')
    When the object Employee name is used in a query, the data is returned

  • Creating a Date Variable

    Hello,
    I'm trying to query for a range of dates Month, Year to Month, Year
    As you can see, the current format of my tables are that [month] = # (1 is January, 2 is February, etc) and [year] in two separate fields.
    How do I create a variable where it takes both month and year fields into a useable date format where I can query a range of months.
    For example, if I want to query October 2013 - March 2014, the fields for [month] and [year] would be 10,2013; 11,2013; 12,2013; 1,2014; 2,2014; 3,2014

    How can I query this variable? Do I have to create the variable in the universe rather than the report? And will the system recognize this as a date format?
    Does it matter if I used /? Is it possible for the formula to register the month name instead of a number (ex. Jan-2014 instead of 1,2014)
    This is what it looks like so far:

  • How to Convert Date Object at Universe Level with out Timestamp

    Hi,
    I have a Object  called "PCREGISTERDATE" at universe where the data type is date .but the dates are coming in the following format:9/26/2007 9:48:40 PM but i want to show the date as with out time stamp.
    how can i create a object by at universelevel which shoul show only date with out Time Stamp.
    please help me on this ASAP.
    Thanks & Regards,
    Kumar

    Please try below date fucntion:
    select convert(varchar(10),getdate(),101)  - this is for sybase
    syntex will change based on your source database.
    Thanks
    Ponnarasu .K

  • Infinite "while" loop subshell loses current date variable

    I have a simple script to log network connectivity to a set of systems.
    However, as expected the date appended to the log never changes because the new variable is lost when the loop starts again. Can someone clue me in on how to get around this issue?
    #!/bin/bash
    LOG=/tmp/netlog
    when=`/bin/date`
    while true;
    do
    for server in srv1 srv2 srv3 srv4 srv5;
    do
    ping -c 1 $server > /dev/null
    if [ $? -ne 0 ]; then
    echo "$server-DOWN!" $when >> $LOG.$server
    # mail
    else
    echo "$server-UP!" $when >> $LOG.$server
    fi
    done
    done

    esa wrote:Jason, from my experience, [] with quotes around variables is generaly more cross-over compatible (bsd'ish, deb'ish, rh'ish) than [[]] without quoting of variables.
    More than once i've had unexpected behaviour caused by using [[ condition ]].
    That's why you'd use /bin/bash instead of /bin/sh .. (or rather /usr/bin/env bash - OpenBSD has bash in /usr/local/bin) - [[ is bash specific.
    http://mywiki.wooledge.org/Bashism
    Last edited by Alad (2015-05-21 13:01:27)

  • Formulas and Variables in Universe

    I have been trying to find out how to create formulas and variables on universe Level.  I know how to accomplish this in Webi.  I'd appreciate if someone can point me to any documentation on this issue.
    Thanks.

    Hi,
    which version of BOBJ are you using? What kind of data sources do you have?
    Here are some documents you can start with:
    Formulas in WebI for XI 3.1
    [http://help.sap.com/businessobject/product_guides/boexir31/en/xi3_web_intelligence_formulas_functions_calculations_en.pdf]
    Formulas in WebI for XI 3.1 SP2
    [http://help.sap.com/businessobject/product_guides/boexir31SP2/en/xi31_sp2_webi_ffc_en.pdf]
    Universe Designer user's guide XI 3.1
    [http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_designer_en.pdf]
    Universe Designer user's guide XI 3.1 SP 2
    [http://help.sap.com/businessobject/product_guides/boexir31SP2/en/xi31_sp2_designer_en.pdf]
    You can find more documentation here
    [http://help.sap.com]
    Regards,
    Stratos

  • How to fill a prompt in webi with current date?

    A webi report is being generated on BEx Query.
    IN BEx query variables are defined for some date fields to prefill them with current date.
    Foe ex. there is license start date. For this field variable is defined so that in variable screen License start date is automatically filled with greater than or equal to current date(which is system date). WHich is a mandatory variable.
    On BO side, a webi report is being developed on a Universe (based on this BEx query).
    When the webi report is run, the license start date(mandatory variable in BEx) is automatically prompted, but date is not getting prefiiled with current date.
    How to prefill this prompt with current date?
    the prompt should be like
    LIcense start date >= <current date>

    Hi,
    Yes, it isn't possible to reference anything like 'Current Date' in the universe (like you would with a SQL data source).
    The solution I have seen recently goes like this, I don't know the exact details (so I might have some terminology wrong), but someone with ABAP skills should get what I mean.
    Assuming you want to filter on 0CALDAY.
    In ABAP, create a customer EXIT that calculates the current date as a number (so today might be 40651). Do the same for 0CALDAY.
    In the BEx create a formula variable that references each of those, then a Formula Key Figure (I forget the exact name of them) that's just the current day number minus the 0CALDAY number. This gives you the 'age' of that row of data.
    Your Webi report can then have a built in filter (or prompt with a default value) of, say Age <= 30. The report can be scheduled and will always run with the last 30 day's data.
    We actually did the customer exists to show the 'age' in months.
    Sorry I can't explain it any better, but it's working great for us.
    Hope that helps.

  • Parsing Issue at Universe Level

    Dear All,
    I am a BO Consultant, for the past few months we (our report developing team) were trying to create new objects at the Universe level (based on requirement) so that we can use the same in the report level, but unfortunately we failed to do the same.
    Actually we are struggling in this case. Every time when we try to create an object with function specified at the Universe level its coming up with errors like this expression is not parsed etc.
    We are using,
    1. SAP BI 7.0 with DB2
    2. SAP BO XI 3.1 Edge
    3. Universe Version 12.3.0 and Build 601
    Universe on top of BW Cubes have any limitations??????????
    Please help us with a solution.
    Regards,
    Arun Krishnan.G
    SAP BO Consultant

    Hi,
    It all depends what your syntax is, and what you are trying to do.
    Also, I would not trust the Parser too much in OLAP BAPI universes.. 
    Here is an SDN guide about OLAP universes and some examples of XML markup required for predefined filters for MDX scenarios.
    [http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/c0a45246-ce76-2b10-e688-f5c8206203eb?quicklink=index&overridelayout=true]
    Regards,
    H

  • Formula date variable ,which is processing by 'Customer exit' with ready in

    Hi ,
    I need to create 1 variable which takes date from user and do some calculation.irrespective of any date char.
    so I have created Formula date variable ,which is processing by 'Customer exit' with ready input .
    But when selection screen pop up date formula variable comes with the format yyyymmdd.
    but i need dd.mm.yyyy. i have checked my profile and it is dd.mm.yyyy.
    Waitin for reply

    Hi Babu
    Did you get the answer to the query....if yes please drop me a mail on this as I have the same requirement and thanks in advance...
    my id   [email protected]
    REgards
    Amit

  • Passing a Date variable to SQL

    Hi,
    I am trying to pass in a Date variable into SQL query, but I am getting this error:
    "inconsistent datatypes: expected DATE got NUMBER"
    and my code looks like this. I would appreciate any help on how I need to create the Date variable that SQL would accept it.
    THANKS A LOT!
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
    String txt = "01/01/1990";
    java.util.Date startYear2 = (java.util.Date) formatter.parse(txt, new ParsePosition(0));
    java.sql.Date startYear = new java.sql.Date(startYear2.getTime());
    String txt2 = "12/31/1990";
    java.util.Date endYear2 = (java.util.Date) formatter.parse(txt2, new ParsePosition(0));
    java.sql.Date endYear = new java.sql.Date(endYear2.getTime());
    String scoredGoalsQuery = "SELECT count(name) from player_goal_rel where name = '" + pName + "' and pdate BETWEEN "+ startYear +" and "+ endYear;
    ResultSet scoredGoalsResult = stmt.executeQuery(scoredGoalsQuery);

    You should be using prepared statements.
    String scoredGoalsQuery = "SELECT count(name) from player_goal_rel where name = ? and pdate BETWEEN ? and ?":
    PreparedStatement pstmt = connection.prepareStatement(scoredGoalsQuery);
    pstmt.setString(1, pName);
    pstmt.setDate(2, startYear);
    pstmt.setDate(3, endYear);
    ResultSet scoredGoalsResult = pstmt.executeQuery();

  • Create a formula variable using replacement path for current date

    Hi All,
    I created a formula variable using replacement path for current date.
    But when i used this variable am getting an error message saying .
    " This Variable cannot be used in this query".
    Could you please let me know the reason?
    Thanks,
    Zehra

    Hi All,
    Thanks for all your help...
    I just found a solution via the below link
    in Bex Formula variabel, Current calander day(sap exit) missing.
    Here he is trying to use the existing formula variable.
    My doubt here is, Even i could not find this varaible in BEX formula variable, But could see this in BI Content path as mentioned in the above link.  DO i have to transport this varaible , or i simply can activate it in production?
    I just could find this in BI Content but not in MetaData Repository.
    Thanks,
    Zehra

  • Create a BEx variable which should by default contain current date, etc

    Hi,
    I need to create 2 variables: ZDATE01 and ZDATE02.
    They will be used in the following situation:
    0DATETO >= ZDATE01
    and
    0DATEFROM <= ZDATE02
    to only display records on a current "key" date.
    ZDATE01 should be a variable that has current date pre-populated in it on the variable entry screen in BEx Web Analyzer, so that users do not have to type in the date themselves.
    ZDATE02 should be a replacement path variable to be replaced by whatever is the value of ZDATE01.
    How would I accomplish ZDATE01 variable having current date pre-populated in it on the variable entry screen?
    I tried creating ZDATE01 variable with having SAP exit variable as replacement path, but it did not let me.
    Thanks

    Sorry, the previous link was wrong...
    Here you go...
    Current System date in report
    WHEN 'XXXX'.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'YYYY'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = sy_datum.
    clear L_S_RANGE-HIGH.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.

  • Create aging bucket in BEx - based on  date variable

    Hi everyone,
    I have a report for which we need to create account receivable aging bucket to classify arrears (1>29 / 30>59 / etcu2026).
    Our solution overall architecture is the following :
    Source System (SAP) >  BW back end...Multiprovider > Super BEx Query > Universe > Webi Report
    BW 7.0
    BO XI 3.2 SP3.0
    In this report, each bucket is defined by the difference between:
    -     the Net Due Date (which is the due date of payment of the invoice)
    -     and the Current Date (date for which the report is run u2013 can be the date of the day or a date in the past)
    We can develop this either in BEx or in Webi, but to avoid potential performance issues in Webi, we take the try to develop this in BEx.
    As you can easily imagine, this BEx query will be used for many reportsu2026so not only for this specific report.
    What weu2019ve done so far:
    1-     We created a variable to prompt the user with the date he wants to run the report for
               - ZTEST is an optional variable, single value, User input, based on characteristic 0CALDAY
    2-     We developed RKF in BEx
    -     Key Figure restricted by Amount
    -     Net Due Date restricted by the variable ZTEST using the between function and an offset (to determine the range)
    => When we save the query we are getting a warning message saying u201CVariable ZTEST for characteristic Net Due Date has been converted to a required entryu201D
    Why? (you probably knowu2026) Because my RKF is using a variable with an offsetu2026which automatically turn on my variable as mandatory and no more as optional.
    Consequences:
    -     In BEx: My variable, which is required to be optional (because we donu2019t have to have this field as mandatory for each and every report running on top of this query) is now mandatory.
    -     In Webi: If I use the variable (funnel in webi), my report is working fineu2026but if I donu2019t use it in the webi report, I get an error message saying u201Cvalue required for ZTESTu201D
    o     Funnel is configured as optional in the universe designer (so the issue is not coming from here)
    => 2 consequencesu2026same issue
    Question: What can we do to keep our bucket logic running in BEx and avoid this variable to become mandatory?
    Solutions (potential)
    -     Create a custom exit routine to work around this issue u2013 how?
    -     Create CKF/Custom exit to create our bucket (using ZTEST as an entry value to determine the range) and then use the created range in our RKF to restrict the amount u2013 how? Not so easyu2026
    -     Build the logic in Webi
    -     Any other suggestions?
    Here we are, any advice would be really appreciated
    Thank you guys
    Regards
    Henri

    Hi peeps,
    We finally find a solution for this problem! So I can share it with you.
    The overall solution is pretty easy to understand.
    1st step is to prompt with the user with a 0DATE variable. The date selected becomes a date input for the next step.
    The variables is defined as a range [01/01/1900;variable_value)...in order to retrieve the right data set.
    2nd step is to use this date to create our aging bucket, dates range.
    To do so, we created 4 user exit variables (for each aging bucket).
    3rd step is to use these ranges in RKF.
    This way you get aging bucket dynamically defined by the user input pretty cool!
    Regards
    H

Maybe you are looking for