How to use to_Char in obiee

Evaluate( 'to_char(%1,%2)' as char,SUM(EQ_HOLDING_FACT.shares),'FM999,999,999,990')
A general error has occurred. [nQSError: 42015] Cannot function ship the following expression: Evaluate( to_char(%1,%2),D1.c18, 'FM999,999,999,990')
how to resolve it

You can use the following as needed: In answers for example:
CAST(your_column AS CHAR)
CAST(your_column as INTEGER)
CAST(you_column as DOUBLE)
-- replace 'your_column' with the appropriate column name.

Similar Messages

  • How to use Javascript in OBIEE?

    Hi all,
    can any one tell how to use javascript in OBIEE. i.e steps to follow to insert the javascript in OBIEE 11g or 10g

    If you are trying to display total number of pages in a report, Add the below formula in the column of the report and hide that column in the report.
    FX = sum(count(1))/25
    You can then reference the column in the narrative view like this: "Total pages in the report are @5" and out put may be "Total Pages in the report are 30".
    Or
    You can also use something like the below:
    To calculate them use fi:
    CEILING(CAST(RCOUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the page number
    CEILING(CAST(COUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the total pages
    Put the above formula in the column and reference it in the narrative view like I mentioned in the previous example.
    If you are report view is pivot, then please refer to this link: http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/
    Hope this helps.
    Thanks,
    -Amith.

  • How to use CLOB in OBIEE 11g (11115) Reporting

    Hello All,
    I have a CLOB object. I need to use that in the report.
    It just has text only. I defied it in RPD as LONGVARCHAR or OBJECT but it did not work out.
    I tried using evaluate with TO_CLOB but i am getting below error any time
    inconsistent datatypes: expected - got CLOB at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed.
    Please give me a clue how to use a CLOB column in report.
    I see a rittmen blog which is using as LOOKUP but i dont have that option either.
    Please let me know what wrong i am doing.
    Thanks in Advance.
    KN

    DBMS_LOB.substr(<table.columnname>,<length of characters>,<start position>)
    Check this
    http://shivabizint.wordpress.com/2010/04/20/varchar2-greater-than-4000-in-obiee/
    Mark if helps.
    Thanks,

  • How to use to_char(oracle function) in java

    Hi,
    I am getting the value as a integer from one table in my java file and want to insert it into another table as a varChar..
    I found one method in oracle like to_char().. can i use this in java..
    can u pls let me know how to use this in java..or is there any other way to convert it..
    for example, i am getting the value is : 4 (number) from one table. and want to insert it into another table like : 04 (varchar)..
    how can i convert it and insert into another table as a varchar..
    please help me

    Well part of the answer depends on what db your using but semantically if I just HAD to do what you're doing I would use a stored procedure to do the insert into the second table or better yet do the whole thing in a stored procedure which would make life much easier all the way around.
    Implicit lesson here: Use the RIGHT tool for the job at hand.
    The big question though is why do you have data that's of one type in one place and another type in another place?
    PS.

  • How to use hints in Obiee to increase performance

    Anybody please tell me how can we use hints to increase performance of ad hoc and dashboard reports in obiee

    Hi,
    Check this,
    http://www.howtoexam.com/index.php?option=com_content&view=article&id=75%3Ausing-hints-in-obiee-rpd-and-answers&catid=790%3Acomputers-and-software&Itemid=166
    Rgds,
    Dpka

  • How to use Table valued MSSQL  function in OBIEE

    Hi all,
    Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
    I know for MSSQL Stored Procedure we can write as
    EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
    but now I have a table valued function in the query window I can get the data as
    select * from myfunction(parametervalue)
    In physical layer of OBIEE I have tried as
    select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
    Can some one help me to solve this.
    Thanks,
    Mithun

    Follow this link and try yourself. let me know for issues
    Substring instr issue in obiee
    Appreciate if you mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 AM

  • How to use SQL OVER and PARTITION BY in OBIEE Expression Builder??

    Hi there,
    I want to create a new logical coulmn with the following SQL query.
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )
    How to use the OVER and PARTITION BY in OBIEE Expression Builder??
    Thanks in Advance

    hi bipin,
    We cant use by in Expression builder(rpd) .But use the same formula like this in Fx of answers
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) >OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )SUM(Inventory Detail.Qty by Detail,ITEM,Mydate)/SUM(qty by detail,item)
    First check the numerator whether it was giving correct results or not then go with denominator
    compare the results with sql that u have
    Let me know if that does work
    thanks,
    saichand.v
    Edited by: Saichand Varanasi on Jul 27, 2010 9:27 PM
    Edited by: Saichand Varanasi on Jul 27, 2010 9:28 PM

  • How to use TRUNC function with dates in Expression Builder in OBIEE.

    Hi There,
    How to use TRUNC function with dates in Expression Builder in OBIEE.
    TRUNC (SYSDATE, 'MM') returns '07/01/2010' where sysdate is '07/15/2010' in SQL. I need to use the same thing in expression builder in BMM layer logical column.
    Thanks in advance

    use this instead:
    TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(CURRENT_DATE) * -1) + 1, CURRENT_DATE)

  • How to use functions(to_char,to_date,trim..etc) in oracle xml table

    Hi I am new to oracle xml.
          In the below scenario how can use the functions like (to_char,To_date,trim..etc) In oracle xmltable."username","password" are inputs to my procedure.
    SELECT *
        INTO l_username,
                  l_password
        FROM xmltable('/InputParameters/ParamSet'
                        passing l_xmldoc
                        COLUMNS
                                l_username  VARCHAR2(28)    path 'username',
                                l_password VARCHAR2(28)     path 'password'
    and please Help how to write above with xmlquery.
    Thanks,

    In the same place you would for any regular SELECT statement
    SELECT TO_CHAR(...),
           TO_NUMBER(...)
      FROM random_table
    WHERE TO_CHAR(...) = col1
       AND TO_NUMBER(...) = col2
    username and password are the results of the SQL statement.  I'm guessing l_xmldoc is the input? There is not need to write something so simple as XQuery so what is your larger goal?  If you provide a clearer example and question, we can help you better.

  • How to use varaibke manager option at RPD in obiee 10g

    Hi
    At RPD level , can anyone please help on uderstanding how to use the variable manager.
    thank you

    Hi,
    System session variables:
    System session variables have reserved names, that cannot be used for other kinds of variables (such as static or dynamic repository variables and non-system session variables).
    e.x:
    1)
    if u want to get and display user login ID,group,timezone...Date and time...etc... can be done by using session variable
    2) Exteranl application integration ( java -jsp) by using go url.
    here u can specify the session variable and it will passed into Java apps.
    3) setting log level by using session varaible
    4) u can use it report tittle/header..etc
    for more:
    http://obiee101.blogspot.com/2008/02/obiee-adding-session-variables-to.html
    http://obiee-blog.info/administration-tool/how-to-set-session-variables-using-url-variables/
    http://sureshotstrategies.blogspot.com/2008/07/about-session-variables-in-obiee.html
    http://inetskills.com/obiee/obiee_11.php
    Thanks
    Deva
    Edited by: Devarasu on Dec 6, 2011 5:10 PM

  • How to use one report column into the another report in obiee

    How to use one report column into the another report in obiee

    i dont want to use column as a filter for another report it should be report column for another report
    Thanks,
    Vivek

  • To_CHAR in OBIEE

    Hello All,
    I have 2 tables variance_trend and monthly_variance.
    Both tables have load_date column.
    In variance_trend it is varchar in the format YYYYMM, in monthly_variance load_date is date data type.
    I am trying to convert monthly_variance.load_date to YYYYMM.I can acheive this by going to data format and select custom format etc.
    But the problem is here i am doing union between these two columns.
    Its throwing me error because these 2 columns are inconsistent data types.(one is varchar another is date).
    In sql i can use to_char(monthly_variance,'YYYYMM') function to acheive this.
    How can i acheive this in OBIEE without creating any views in database.
    Thanks in advance.

    Hi ,
    Thanks for your reply.
    Since month(monthly_variance.load_date) return the month value in single digits for 1 to 9, instead of 200901 i am getting 20091 for the month January and so on.
    I looked into functions , but i could not find any lpad function.
    Is there any other function similar to lapd in OBIEE?
    Thanks in advance.

  • How to use i for if condition in a for i in loop?

    Hi friends,
    I have a question on how to use i for IF condition in a loop, in order to get an efficient programming and results. Here is outlined SQL:
    cursor is
    select c1,c2,c3 from table1; -- 100 rows returned.
    open cursor
    loop
    fetch c1,c2,c3 into v1,v2,v3;
    for i in 1..3 loop
    if 'v'||i between 90 and 100 then
    v_grade := 'Excellent';
    elsif 'v'||i between 80 and 89 then
    elsif 'v'||i between 50 and 59 then
    end if;
    end loop;
    close cursor;
    This way, I don't need to use a lot of if..then for hard code v1,v2,v3,.... actually I have more v..
    But Oracle gave an error of this usage of 'if 'v'||i' or 'v'||to_char(i).
    Thanks for any advice in advance!

    user508774 wrote:
    Thanks for comments and advices. But I didn't get your inputs clearly. Are you saying I don't need to use PL/SQL to achieve this?Correct. Ronel and John showed you the basic approaches. SQL is not a mere I/O language for making read and write calls. It is a very capable, flexible and powerful language. One can solve a problem with a few lines of SQL code, that will take 100's of lines of PL/SQL or Java code.
    So do not underestimate what can be done in SQL.
    v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
    EXECUTE IMMEDIATE v_cmd;This code is also wrong. Besides the fact that there is no need for dynamic SQL, this approach creates a brand new SQL statement each loop iteration.
    SQL is source code. It needs to be parsed (compiled). The end result is an executable program that is called a cursor. This cursor needs to be stored in server memory (the SQL Shared Pool in the SGA).
    The problem with your code is that it is slow and expensive - it generates lots of unique SQL statements that need CPU for parsing and server memory for storage.
    These add up to a very significant performance overhead. That is the wrong approach. The correct approach is the same one that you would use in any other programming language.
    Let's say you need to use Java to process a bunch of CSV files - exact same CSV layout used by each file. A file needs to be read, processed, and a log file created.
    Will you write a Java program that loops through the files, for each file found, write a Java program for processing that file, compile it, then execute it?
    Or would you write a Java program that takes the name of the file as input, and then process that file and writes the log file?
    The 2nd approach provides a program that can process any of those CSV files - one simply needs to pass the filename as an input parameter.
    Your code and approach use the 1st method. Not the 2nd. And that is why it is wrong.
    To create a SQL program with parameters is done by using bind variables. Instead of
    v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
    The following SQL source code should be created:
    v_cmd := 'UPDATE parts_categ_counts SET w1=:v1, w2=:v2 ..., w9=:v9 WHERE seq= :vseq';
    The tokens with the colon prefix (such as :v1), are bind variables. Think of these as the parameters to the SQL cursor.
    The server parses this SQL into a cursor. You can now execute the same cursor over and over again, using different bind variables. (just like the 2nd approach above that one would use in Java)
    In PL/SQL, this is made even easier as you can code native SQL code with PL/SQL code and use PL/SQL variables in it. The PL/SQL compiler is clever enough to do the SQL parsing, variable binding, and cursor execution for you. So in PL/SQL, you would use:
    UPDATE parts_categ_counts SET w1=v1, w2=v2 ..., w9=v9 WHERE seq= vseq;
    Where v1 and the others are PL/SQL variables.
    That all said - PL/SQL is only used for data crunching, when the processing of data is too complex for the SQL language to deal with. And this is very seldom the case.
    The main reason for using PL/SQL it to provide processing flow control, conditional processing and error handling, for SQL code. As the SQL language does not have these features.

  • How to use complex function as condition in Oracle Rule Decision Table?

    How to use complex function as condition in Oracle Rule Decision Table?
    We want to compare an incoming date range with the date defined in the rules. This date comparison is based on the input date in the fact & the date as defined for each rule. Can this be done in a decision table?

    I see a couple of problems here.
    First, what you posted below is not a syntactically valid query. It seems to be part of a larger query, specifically, this looks to be only the GROUP BY clause of a query.
    Prabu ammaiappan wrote:
    Hi,
    I Have a group function in the Query. Below is the Query i have used it,
    GROUP BY S.FREIGHTCLASS,
    R.CONTAINERKEY,
    S.SKU,
    S.DESCR ||S.DESCRIPTION2,
    S.PVTYPE,
    RD.LOTTABLE06,
    R.WAREHOUSEREFERENCE,
    RD.TOLOC,
    R.ADDWHO,
    R.TYPE,
    S.CWFLAG,
    S.STDNETWGT,
    S.ORDERUOM,
    R.ADDDATE,
    C.DESCRIPTION,
    (CASE WHEN P.POKEY LIKE '%PUR%' THEN 'NULL' ELSE to_char(P.PODATE,'dd/mm/yyyy') END),
    NVL((CASE WHEN R.ADDWHO='BOOMI' THEN RDD.SUPPLIERNAME END),SS.COMPANY),
    RDD.BRAND,
    S.NAPA,
    RD.RECEIPTKEY,
    R.SUSR4,
    P.POKEY,
    RDD.SUSR1,
    r.STATUS, DECODE(RDD.SUSR2,' ',0,'',0,RDD.SUSR2),
    rd.SUSR3Second, the answer to your primary question, "How do I add a predicate with with a MAX() function to my where clause?" is that you don't. As you discovered, if you attempt to do so, you'll find it doesn't work. If you stop and think about how SQL is processed, it should make sense to you why the SQL is not valid.
    If you want to apply a filter condition such as:
    trunc(max(RD.DATERECEIVED)) BETWEEN TO_DATE('01/08/2011','DD/MM/YYYY') AND TO_DATE('01/08/2011','DD/MM/YYYY')you should do it in a HAVING clause, not a where clause:
    select ....
      from ....
    where ....
    group by ....
    having max(some_date) between this_date and that_date;Hope that helps,
    -Mark

  • How to use partition by instead of group by?

    Hi,
    I am having trouble using partition by clause in following case,
    column other_number with null values contains 10 records in 'some_table'
    5 records with date 11-01-2009, item_code = 1
    5 records with date 10-01-2009, item_code = 2
    This query returns all 10 records, (which suppose to return 2)
    SELECT count (a.anumber) over (partition by TO_char(a.some_date,'MM'), a.item_code) AS i_count, a.item_code,
    TO_char(a.some_date,'MM')
         FROM some_table
         WHERE to_char(a.some_date,'yyyy') = 2009
         AND a.other_number IS NULL
    Works fine if I wrote like this,
    SELECT count (a.anumber) AS i_count, a.item_code,
    TO_char(a.some_date,'MM')
         FROM some_table
         WHERE to_char(a.some_date,'yyyy') = 2009
         AND a.other_number IS NULL
    group by TO_char(a.some_date,'MM'), a.item_code
    How to use partition by in this case?

    Hi,
    Almost all of the aggregate functions (the ones you use in a GROUP BY query) have analytic counterparts.
    You seem to have already discovered that whatever values are returned by
    an aggregate funcition using "GROUP BY x, y, z" can also be found with
    an analytic function using "PARTITION BY x, y. z".
    Aggregate queries collapse the result set.
    The aggregate COUNT function:
    SELECT    deptno
    ,         COUNT (*)   AS cnt
    FROM       scott.emp
    GROUP BY  deptno
    ;tells how many of the 14 employees are in each of the 3 departments.
    So does the analytic COUNT function:
    SELECT    deptno
    ,         COUNT (*) OVER (PARTITION BY deptno)   AS cnt
    FROM       scott.emp
    ;but the first query produces 3 rows of output, the second query produces 14.
    You could get 3 rows of output using the analytic function and SELECT DISTINCT , but it's inefficient.
    Which should you use? Like so many other things, the answer depends on what data you have, and what results you want from that data.
    If you want collapsed results (one row per group), that's a striong indication that you'll want aggregate, not analytic functions.
    If you want one row of output for every row in the table, that's a strong indication that you'll want analytic functions.
    If you have a particular question, ask it. Post some sample data and the results you want from that data, as Rob said.
    There is another important difference between aggreate and analytic functions: analytic functions can easily be restricted to a window , or subset, of the data set. This is something like a WHERE clause, but a WHERE clause applies to the whole query: a wondowing condition applies only to an individual row.
    If you need to compute a SUM of rows with an earlier order_date than this row or an average of the last 5 rows, then you proabably want to use analytic function.

Maybe you are looking for

  • How do I add different sites to search engines

    How do I add other search engines or sites to my drop down list? When I visit a site nothing comes up in the drop down menu to 'add it' like the instructions say and you can't manage it to add. I want to add Dogpile and at the Dogpile site it says 'a

  • Error while issuing an httpService from a local swf

    We have a swf that  includes a Flex HTTPService call to check for tomcat status. This  call is resulting to below error: Error #2028:  Local-with-filesystem SWF filefile:///C:/......./click.swfcannot  access Internet URLhttp://localhost:8600/.../dumm

  • How to Download Employee W2 information in EFW2 format

    Hi, I am new to Tax Reporting in HR. We have a requirement to download Employee W2 information in EFW2 format and send to third party vendor after the employee's consent. Can you please throw some light on the procedure and pre-requisites to do this.

  • Classic environment and sound speed

    I can't get older software to run in Classic Environment without it sounding like an old episode of The Chipmunks. The sound is so speedy, I can't understand it. Video runs fine. I'd appreciate any help. Thank you!!

  • Please help me to decide the best deign for my web app

    I'm quite new to j2EE developement. Currently im working on a web based user management application ( a small scale one ). For that im hoping to use JSP s for presentaion tier and EJBs for business logic. This business logic seems to be having more o