Syntax for EVALUATE function - placing condition in it

Hello All,
I have a formula in discoverer like this
SUM(col1)
OVER(PARTITION BY col2, col3, col4
ORDER BY col5 ASC
RANGE BETWEEN col6-3 AND col6
I need to implement the same in BI,
I have used this to implement the SUM part
EVALUATE( 'SUM(%1) OVER ( PARTITION BY %2,%3,%4) ORDER BY %5)' as double,
col1,
col2,
col3,
col4)
But, couldn't get the syntax for 'RANGE BETWEEN' clause..
i have tried like this
EVALUATE( 'SUM(%1) OVER ( PARTITION BY %2,%3,%4) ORDER BY %5 RANGE BETWEEN %7 AND %6 )' as double,
col1,
col2,
col3,
col4,
col5,
col6,
col7)
Its throwing an error 'ORA-00905: missing keyword at OCI call OCIStmtExecute.'
can anyone please suggest me some ideas to resolve this.
Thanks in advance,
Raghu

Hi Goran,
Thanks for the reply, it was of great help..
Can you once check this please
EVALUATE( 'SUM(%1) OVER ( PARTITION BY %2,%3,%4,%5
ORDER BY %6 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW )' AS DOUBLE,
"Global Distributor Sales (by Period)"."Net Sales",
Specialist."Specialist Group Name", Specialist."Specialist Manager Name",
Specialist."Specialist Name", "End Sold-To Customer"."Sold-To Customer
Account Name", "Process Fiscal Period Calendar"."Fiscal Period")
This is giving the running sum of values with in the partition window..
but, can you suggest, how to modify the query, so as to get the values of 'Sales' between
2 fiscal periods back and the current fiscal period..
in the discoverer it is used like this,
SUM(Net Sales SUM)
OVER(PARTITION BY Specialist Group Name,Specialist Manager Name,Specialist Name,"Sold-To Customer Account Name",GPH Segment2
ORDER BY "Fiscal Period (7)" ASC
RANGE BETWEEN NUMTOYMINTERVAL("Fiscal Period Of Year"-1,'MONTH') PRECEDING AND CURRENT ROW )
which gives the values between 2 periods back and current period
Thank you,
Raghu

Similar Messages

  • Syntax for Evaluate function in OBIEE

    Hi
    I have browsed through the docs but couldn't find syntax for Evaluate function. Could someone pass me the full syntax and if possible a helpful example against essbase.
    Thanks

    Hi
    definitely
    syntax:- EVAULATE('your db function(%1,%2)', parameter list)
    here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
    if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
    following exapmples are for ORACLE db,
    ex1: EVALUATE('upper(%1)', 'kishore kumar') gives the result as -> KISHORE KUMAR
    ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
    you also can call the user-defined functions through evaulate
    EVALUATE('functioname(%1,%2), column1, column2)
    the above function has 2 parameters to be inputted
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Jan 16, 2009 11:00 PM

  • Is there any alternative for Evaluate function

    Hi all
    Can anybody tell me the alternative for evaluate function. i have to use a SQL Function and execute it from obiee

    Agreed with John. You best create a view in the DB or - if you don't have the rights - you can just put this SQL code in the physical layer as a physical table object of table type "Select".
    In UDML:
    DECLARE TABLE "ABC".."SH"."test" AS "test" UPGRADE ID 1 NOT CACHEABLE NO INTERSECTION
         TABLE TYPE SELECT DATABASE MAP (
               {DefaultMulDB}  AS {select a.job_id,
         a.name title,
         flsa.meaning flsa,
         eeo.meaning eeo_category,
         a.attribute1 job_family,
         c.name grade
    from per_jobs a,
         (select * from per_valid_grades where sysdate between date_from and nvl(date_to, sysdate + 1)) b,
         (select * from per_grades where sysdate between date_from and nvl(date_to, sysdate + 1)) c,
         (select lookup_code, meaning from hr_lookups where lookup_type like 'US_EXEMPT_NON_EXEMPT') flsa,
         (select lookup_code, meaning from hr_lookups where lookup_type like 'US_EEO1_JOB_CATEGORIES') eeo,
         (select lookup_code, meaning from hr_lookups where lookup_type like 'ALB_HR_JOB_FAMILY') jf
    where sysdate between a.date_from and nvl(a.date_to, sysdate + 1) and
         b.job_id (+) = a.job_id and
         c.grade_id(+) = b.grade_id and
         flsa.lookup_code (+) = a.job_information3 and
         eeo.lookup_code (+) = a.job_information1 and
         jf.lookup_code (+) = a.attribute1}  )
         PRIVILEGES ( READ);Cheers,
    C.

  • Syntax for existing function-based index

    Hi:
    I am on 10.2.0.3.
    Listed below is the list of indexes and index columns on one of the tables. Aparantly one of the columns (SYS_NC00220$ ) is in reality a function-based index.
    Anybody knows how to get SQL syntax for this index? TIA.
    INDEX_NAME UNIQUENES COLUMN_NAME COLUMN_POSITION
    PS0BI_HDR NONUNIQUE BILL_TO_CUST_ID 1
    PS0BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS0BI_HDR NONUNIQUE SYS_NC00220$ 3
    PS1BI_HDR NONUNIQUE BILL_STATUS 1
    PS1BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS1BI_HDR NONUNIQUE SYS_NC00220$ 3
    PS2BI_HDR NONUNIQUE CONTRACT_NUM 1
    PS2BI_HDR NONUNIQUE BUSINESS_UNIT 2
    PS2BI_HDR NONUNIQUE SYS_NC00220$ 3
    PSABI_HDR NONUNIQUE INVOICE 1
    PSABI_HDR NONUNIQUE BILL_TO_CUST_ID 2
    PSABI_HDR NONUNIQUE BUSINESS_UNIT 3
    PSABI_HDR NONUNIQUE BILL_STATUS 4
    PSBBI_HDR UNIQUE PROCESS_INSTANCE 1
    PSBBI_HDR UNIQUE BUSINESS_UNIT 2
    PSBBI_HDR UNIQUE INVOICE 3
    PS_BI_HDR UNIQUE BUSINESS_UNIT 1
    PS_BI_HDR UNIQUE SYS_NC00220$ 2

    query user_ind_expressions and look for COLUMN_EXPRESSION.
    this will give you expression.

  • Date Syntax for SUMIFS Function

    Converting my accounting from Excel to Numbers. Huge data sets ...
    I have a SUMIFS function that works properly using a manually typed date but I cannot figure out how to use the Today() function.
    This works: SUMIFS(Amounts, Account, B3, Check Date, B5) where B3 is the code for the specific account and B5 contains <=12/31/2009 - note there are no quotes around the expression.
    BUT, I don't want to manually enter the date everyday. I want to use the Today() function for condition. It works if I use Today() in B5 but returns only the totals for today's transactions. I need to be able to use "less than or equal to Today" for the condition but I cannot figure out the syntax.
    If we can figure that out, then I want to use "less than or equal to Today PLUS X" where X is a variable I can enter in B7 to look at projected cash flow 7, 14 or 21 days out.
    Any help? Thanks

    Jane Knox wrote:
    Yvan!
    That worked. Thank you! When I posted the question I thought you would be the one to answer.
    Thanks for the feedback.
    I'm sure that Ashka, Badunit, Barry, Fruhulda, Jaxjason, Jerrold … are able to respond the same.
    The difference is that I was in front of my computer when they weren't
    I would NEVER be able to figure that out
    Not surprising, the syntax required to use a reference to a cell in a testr is not described in delivered resources.
    Very different from Excel...
    Happily, Numbers isn't duplicating Excel behaviour. A world with a single kind of spreadsheet would be really annoying
    Yvan KOENIG (VALLAURIS, France) samedi 26 décembre 2009 18:12:19

  • Syntax for @MDSHIFT function

    I'm attempting to create matrix type results for several accounts, displaying a rolling 12 months. An alternate hierarchy is one solution, but would like to try a calcscript using @MDSHIFT."Incomeprior" =@MDSHIFT("MTotalIncome", 1, "2002", , 0,"Income Stmt Accounts",);The error received is "The 2nd parameter of function "2002" must be a non-negative number or Lev/gen name string"Any ideas?Thank you in advance,Cbucklin

    Hi
    definitely
    syntax:- EVAULATE('your db function(%1,%2)', parameter list)
    here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
    if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
    following exapmples are for ORACLE db,
    ex1: EVALUATE('upper(%1)', 'kishore kumar') gives the result as -> KISHORE KUMAR
    ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
    you also can call the user-defined functions through evaulate
    EVALUATE('functioname(%1,%2), column1, column2)
    the above function has 2 parameters to be inputted
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Jan 16, 2009 11:00 PM

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • Proper syntax for email function including a repeat region

    Hey Guys, a fellow ADDT developer and myself ran into a odd challenge recently and was wondering if someone knew a shorter answer.
    LET ME BE CLEAR..I’m not looking for a suggestion, we have resolved the problem..we ARE LOOKING FOR PROPER or shortest FORMAT.
    (we used a submit redirect to a php page that used the “Send Page Section”  and then redirected back..the email looks great)
    This may be a mood point since ADDT is going away but, until then, we feel this will be an useful post because quite often you may have multiple products to email from your SQL statement.
    With that said. We used the send email function on submit.
    1.       Our email content was a HTML content file. Since it was not a php file our repeat region obviously did not work.
    2.       We substituted the HTML file for PHP (just for giggles)..no joy
    3.       We tried regular content as a string..no joy
    We know how to get single rows with the  {table.column} format…but we need to list all undetermined number of products/rows.
    So how would the string or function re-write look  if you needed a repeat region.
    EX:
    emailContent (“ this” . ‘does’. “work”);  regular string
    emailContent (“ this” . $var   . “work”);  regular string
    emailContent (“ this” .   do{  $row; } while( xxx = xxx)  . “work”);  DOES NOT WORK
    emailContent (“ this” .   while( xxx = xxx)  {  $row; }   . “work”);     DOES NOT WORK
    I assume the conflict is you can’t have a function like DO or While in the string….but I also can’t use a php include file.
    There must be a shorter, cleaner syntax that won’t require an advanced set of arrays or for each???
    so  how would a nice clean example of  repeat region results  inside email content, or include file for email contnent, look?
    Thanks

    David, in theory I agree with you, but to a large degree I am completely changing the logic of my human interface. My existing code pre-processes the raw data and saves the results to disk for any future usage. 
    It can then rapidly rebuild all pages for the entire Intranet site when your personal view of the data is changed. 
    After the full creation of all pages, the fixed pages can be viewed using your browser. 
    When you want to change your view, you run the code which completely rebuilds every Intranet page.
    My new software will approach the data differently.  My raw data will be stored with no pre-processing. The pre-processing will occur as the user changes dates and the pages will be built individually on demand, one at a time.
    The second phase of my Windows Form app will be to create pop-up windows that allow the users to modify the definitions for their custom views of the market. 
    When a view is changed, the software will be able to pre-process, as needed, the current date’s data and rebuild the current page with any new changes.
    I intend to create a Refresh.cpp file.  The various segments of the Form’s code will set variable such as date change, view changed, watch list changed, etc. and then call Refresh(). 
    The refresh code will then be able to do the minimum recalculation necessary to rebuild the proper HTML stream. 
    This is another reason to break up the code into various cpp segments such as: LoadRawData, RecalculateViews, BuildPage, etc.
    PS: David, I tried to send you a personal e-mail using your home page link. 
    Hope that was OK and not against forum rules!

  • Syntax for nested function/procedure?

    Hi,
    What's the syntax to create a sub function/procedure in another function/procedure? Is this available in 9i?
    Thanks.

    Nested functions and procedures have been available since at least 7.3. However, any nested functions or procedures need to be the last things in your declare section.
    This works:
    SQL> CREATE OR REPLACE PROCEDURE test_proc is
      2     l_v VARCHAR2(100);
      3     FUNCTION nested_function RETURN VARCHAR2 IS
      4     BEGIN
      5        RETURN('nested function call') ;
      6     END;
      7  BEGIN
      8     l_v := nested_function;
      9     DBMS_OUTPUT.Put_Line(l_v);
    10  END;
    11  /
    Procedure created.But this does not:
    SQL> CREATE OR REPLACE PROCEDURE test_proc is
      2
      3     FUNCTION nested_function RETURN VARCHAR2 IS
      4     BEGIN
      5        RETURN('nested function call') ;
      6     END;
      7     l_v VARCHAR2(100);
      8  BEGIN
      9     l_v := nested_function;
    10     DBMS_OUTPUT.Put_Line(l_v);
    11  END;
    12  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE TEST_PROC:
    LINE/COL ERROR
    7/4      PLS-00103: Encountered the symbol "L_V" when expecting one of the
             following:
    12/0     PLS-00103: Encountered the symbol "end-of-file" when expecting
             one of the following:
             begin function package pragma procedure formTTFN
    John

  • Which is correct Syntax for IN function in SQL expressions filters?

    Hi,
    I want to build a report which looks at the last 4 snapshot dates.
    I obtained each snapshot date using this filter
    Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 7 - dayofweek(current_date) + 2), current_date) ) A
    now the second one would be:
    Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 6 - dayofweek(current_date) + 2), current_date) ) B
    third one
    Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 5- dayofweek(current_date) + 2), current_date) ) C
    4th one
    Snapshot Date."Snapshot Date" =TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 4 - dayofweek(current_date) + 2), current_date) ) D
    to simplify them let's call the filters A, B , C, D
    so, my sql expression should be like something like Snapshot Date."Snapshot Date" in 'A', 'B', 'D', 'C'
    I have tried to combine the below, with brackets and comma separated, without brackets, with single quotes and without, but I always get a syntax error.
    Snapshot Date."Snapshot Date" in TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 7 - dayofweek(current_date) + 2), current_date) ) ,
    TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 6 - dayofweek(current_date) + 2), current_date) ) ,
    TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 5 - dayofweek(current_date) + 2), current_date) ) ,
    TIMESTAMPADD( SQL_TSI_WEEK,-10, TIMESTAMPADD(SQL_TSI_DAY, ( 4 - dayofweek(current_date) + 2), current_date) )
    It doesn't seem to like the IN function either.
    Any idea?
    Regards
    G.
    Edited by: user6185307 on Oct 27, 2009 8:07 AM

    Take each of these filters and union them in your answers report.
    This way, you filter down to exactly the last 4 days.

  • Syntax for CASE Function when multiple values equates to the same result?

    Tried using the 'IN' keyword with the CASE function but it does not work, does each case have to be stated separately? trying to save some lines..
    tried:
    case me607.rmc_code
    when in ('M','MS','MP') then 'H311'
    end as carrier_code
    Do i have to do:
    case me607.rmc_code
    when 'M' then 'H311'
    when 'MS' then 'H311'
    when 'MP' then 'H311'
    end as carrier_code,
    etc..
    Thanks for any help..

    One other thing forgot to ask, how do you do a second case selection as:
    case when me607.rmc_code
    in ('M','MP','MS') then 'H311'
    case when me607.rmc_code
    in ('1','2') then 'H252'
    end as carrier code
    wanting to keep the results in carrier_code..
    Thanks..
    Edited by: user12296489 on Dec 10, 2009 3:53 PM

  • Is this a valid syntax for main() function

    hi
    here is a very basic question...
    is this signature a valid entry point to an application..?
    public static int main(String[] arg)
    i compile it and it gives me no error but when i run it, it throws an exception in main...
    I am asking this question because one of the certification books has a question which says that this is a valid signature.
    please do let me know ur comments...
    thanks a lot.

    thanks for all the replies....
    it compiles and here is the run time error that i get
    Exception in thread "main" java.lang.NoSuchMethodError: main
    also the book is Complete Java2 Certification study guide 2nd Ed Sybex
    chapter 1, page 26, question 3.
    which of the following sig. are valid for the main() method entry point of an application
    a> public static void main()
    b> public static void main(String arg[])
    c> public void main(String[] args)
    d> public static void main(String [] arg)
    e> public static int main(String [] arg)
    so the answers shud be b,d and not b,d,e right?
    thanks

  • Evaluate function error! how to use it properly?

    Hi,
    I used evaluate function to use a user-defined stored function present in my DB. But I ended up with this error.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1722, message: ORA-01722: invalid number at OCI call OCIStmtExecute: select distinct T119198.BCREFNO as c1, T119198.MATURITY_DATE as c2, T119198.BILL_DUE_AMT as c3, test_eval('"Contract BC Parameters Fact"."Bill Amt Lcy"') as c4 from BCTBS_CONTRACT_MASTER T119198 /* BC_BCTBS_CONTRACT_MASTER */ order by c1, c2, c3, c4. [nQSError: 17011] SQL statement execution failed. (HY000)
    I used the following evaluate function in my report under Edit Column Formula of the particular field.
    EVALUATE('test_eval(%1)','"Contract BC Parameters Fact"."Bill Amt Lcy"')
    The test_eval function in my DB takes one parameter of type number and returns a number. The "Contract BC Parameters Fact"."Bill Amt Lcy" field is of DOUBLE type as found in BMM layer.
    I wish to know if I am right by placing the evaluate function in report or should I use it in BMM layer? Can I get anybodies assistance in knowing how to arrive at using a DB user-defined function in a report.
    Regards,
    The MasterMind.

    hi,
    This is the syntax
    *EVALUATE('DB_Function(%1)' as returntype, {Comma separated Expression})*
    Please check this post
    Re: Syntax for Evaluate function in OBIEE

  • Can Evaluate function return object type

    Hi
    Evaluate function can be used to call db functions in OBIEE. I have a function which returns an object ( pl/sql table).
    Created a simple report in Oracle Answers and added following in one of the columns
    evaluate( 'get_ccid(%1)' as t_ccid , @{p_request})
    When I try to run this in Oracle answers, getting syntax error. If same function returns varchar or number it works well.

    evaluate( 'get_ccid(%1)' as t_ccid , @{p_request})Eakta, You syntax seems to be wrong here. What type of data your presentation variable contains here ?? You are saying its working fine with Number datatype..so can you try..somthing like below with some default value..
    EVALUATE('get_ccid(%1)',@{p_request}{2})
    OR
    EVALUATE('get_ccid(%1)' as varchar(250),@{p_request}{ABC})
    Also, refer
    Syntax for Evaluate function in OBIEE
    http://108obiee.blogspot.com/2009/04/using-presentation-variable-from-first.html
    Hope its useful

  • Can we use Evaluate function in Prompt

    Hi all
    Can we use Evaluate Function in Dashboard Prompt?
    I need some exposure on how to use it.
    I am working on a HRMS-OLTP Source where I need to work with Oracle Functions from OBIEE.
    IF somebody can tell me that, It will be a favour for me....
    ThanQ
    Anand V

    Hi All,
    Here's an example of how to use evaluate. This use calls the Oracle TO_DATE function: EVALUATE('TO_DATE(%1,%2)' as DATE, '03/03/2009', 'MM/DD/YYYY')
    Here's how it works: EVALUATE( '<FUNC>' AS <DATATYPE>, VALUE1,VALUE2,etc)
    FUNC) Is the syntax for the function you are calling. Any parameters have to be replaced by %<number>, where number refers to the order in which you specify your parameters.
    DATATYPE) The datatype that the function will evaluate to. In this case, DATE.
    VALUE1) The latter part of the formula is a comma separated list of all the parameters used in the function. In this case, it's the date I want to cast
    VALUE2) This is the second parameter. You need as many as you referenced in your function. In this case, it's the date format.
    Good luck and if you found this post useful, please award points!
    Best regards,
    -Joe

Maybe you are looking for

  • Flash in Template Pages

    I placed two Flash object into a template page. Child pages made from it worked fine until I made a change to the template. After that, the Flash objects are no longer visible when previewed in the browser. Is this normal? Is there a way around it? O

  • ADF Faces table with checkboxes

    Hi, My dev env: jdev 11.1.1.2.0 I like to implement something like yahoo mail, with a checkbox at the column header. If selected, all rows will be selected. I assume Yahoo's email is using javascript. How do I achieve the same thing here with adf fac

  • Universal Dock plus ipod Touch

    Hey guys, I was thinking of buying the Universal Dock for my iPod Touch, but do I need to buy the Apple branded AV cables too, if I want to plug it into a tv? I know the older AV cables don't work on the Touch, but is it different using the dock? I w

  • App Parts require authentication when using other browsers e.g. Safari on iPad

    Hi all I have the SharePoint App Store setup and working correctly and within Internet Explorer I have my App Store domain and my SharePoint domain added as local intranet sites and authentication is not an issue.  Is there a way of removing the requ

  • Cannot save, "Bad file handle"

    Hello. I am using Acrobat Pro 9, and have added information to a PDF from the USPS using the typewriter tool. I left the document open overnight, and now it will not save. When I click "save" I get a message that it is read-only or may be in use (hig