Essbase 9.3 Calc scripts. Pb with dates. How to convert (string = number) ?

Hello,
I've a problem with Essbase(Planning?) Scripts on version 9.3. It looks simple but I do not find any (clean) solution :
On my Essbase database, I have a member called "Reference_Date" on my axis Indicators. It is a date data type, that is to say, it displays a number corresponding to a YYYYMMDD format. For example : 20091029 for October 29th 2009.
In calc scripts I often need to compare the month included in that "Reference_Date" with the current Member of my Time Axis (I have 12 Months members based on the format M02 for February for example). The final aim is to calculate a number of complete years since that "Reference_Date".
But theses two elements are not of the same "type" (one is a number value and the other is a "member" in Time Axis). So I'm forced to convert one of this two elements in order to compare it.
For example I can extract the month value of the "Reference_Date"' and put an "M" before it to have a Time member equivalent or I can convert the member Name M10 to a number (10))
in both cases I have the same type problem : I don't know how to convert a string into a number nor how to convert a number into a string.
(For example @CONCATENATE doesn't work with numbers). and that my only remaining problem.
I didn't find any Essbase Function which do this (conversion number <=>string).
Is anyone have an Idea ?
Thanks for your help
Best regards

I don't know any way for you to compare your data against your metadata. Not directly. To me it makes little enough sense to try that I'm not surprised the developers didn't provide for it.
I've converted member names to strings, manipulated the strings (calc script functions are not good at this), and turned them back into member names, but that's really the only use I've had for string manipulation. I don't think an equivalency operator even exists for string data. And I see no way to begin thinking of a member name, once converted to a string, as a number.
It makes even less sense to me to try thinking of a data value as a string. Even text values in Sys 11 are stored as numbers. Not encoded characters, but just a number to look up somewhere.
I think you can do what you want though, with something like this...
IF (@ISMBR("FY08"))
vYr = 2008;
ELSEIF (@ISMBR("FY09"))
vYr = 2009;
ENDIF;
IF (@ISMBR("M01"))
vMth = 1;
ELSEIF (@ISMBR("M02"))
vMth = = 2;
ENDIF;
"Years_Since_Reference" = ((vYr * 100) + Mth) - ("Reference_Date" / 12);
Obviously, the math will need some work, coz that doesn't actually work, but the logic above essentially turns your metadata into numbers, which is what you are after.
Good luck,
-- Joe

Similar Messages

  • The export file from a calc script - naming and date/time stamp

    Here is a simple calc script to export data.
    2 questions:
    1. Is there an easy way to add a date/time stamp on the name of the data file so that it does not overwrite the older ones every time?
    2. I tried to specify the path so that it write to another server. "\\mfldappp011\E:\Exp_AW.txt". It's not working. How should I specify the path ?
    Fix (@Relative("Yeartotal",0),"Actual","Working",&ActualYear);
    Dataexport "file" "," "C:\Exp_AW.txt" "#MI";
    EndFix;
    Edited by: user9959627 on Sep 7, 2012 11:25 AM

    Probably easiest to call the maxl script from a command line script, then rename the exported file to include the tme stamp and copy/move it to a location.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • OBIEE 11g write back to Essbase and run calc script feature

    Hi,
    I have a requirement to write back into Essbase Cube and run calc script from OBIEE dashboard.
    From what i have search on google, we must deploy additional Java Script into weblogic, but that is before OBIEE 11.1.1.6.
    I have 2 question:
    - Does OBIEE 11.1.1.6 already supported native write-back to Essbase and running calcscript?
    - Anyone has example of the custom java-script for write back and running calcscript?
    And another, if there are requirement like this, is it better to install Essbase Add-in on Microsoft Excel and do the what-if analysis there, then just display the report on OBIEE dashboard? (based on user-friendliness and the complexity on maintenance)
    Thanks in advance.

    Hi,
    Even I am trying to achieve the same thing as you have mentioned but think that it is not possible to achieve easily in obiee 11.1.1.6, though we do have a work around to perform a writeback in Essbase cube using JAPI as mentioned below.
    Also we can call Hyperion reports from OBIEE using Action Links and also pass parameters to the same but dont know if it runs calculation script.
    Below link could be useful for you for write back workaround.
    http://oraclebizint.wordpress.com/2009/05/25/oracle-bi-ee-10-1-3-4-1-writebacks-to-essbase-using-japi-and-custom-html-part-1/
    Let me know in case you have found out anything else related to same.
    Thanks,

  • Can not run the calc scripts by mxl, if the first character is Number

    I found that if you create the calc scrpt like 1abc.csc. You can not run it by mxl. I tried for times but do not know the reason for that. I found that you can use number in the name of the calc scripts(like abc1.csc, a1bc.csc), but not for the first character(like 1abc.csc).
    Below is my mxl scripts:
    ×××××××××××××××××××××××××××××××××××
    login admin identified by password on localhost;
    spool on to 'C:\abc.log' ;
    execute calculation sample.basic.1abc;
    spool off;
    logout;
    ×××××××××××××××××××××××××××××××××××
    I write a bat file below:
    ×××××××××××××××××××××××××××××××××××
    D:\Hyperion\AnalyticServices\bin\essmsh C:\abc.mxl
    ×××××××××××××××××××××××××××××××××××
    I can run the scripts if I change the name "1abc" to "abc1"or "a1bc".
    Of course I can run this calc in EAS, no matter the name is "1abc" or "abc1".
    Anybody find the same problem with me?

    I agree, if ever there was a "best practice" to developing scripts (especially when using variables) it is to enclose in single quotes. I actually use double quote, single quote.
    execute calculation "'$4'"."'$5'"."'$6'";

  • How to convert string yyyy-mm-dd to date dd/mm/yyyy

    Hi Experts,
    I am getting date in the form of string 2007-06-30 from R/3. How I can convert this string into a date in the form 30/06/2007. I have to use java.sql.Date.
    Following code is not working. As for executing the following code, I have to use java.util.date. I can not use java.util.date as the Web Dynpro program uses java.sql.Date.
         SimpleDateFormat sdf1 = new SimpleDateFormat("dd/mm/yyyy");
         Date d = null;
         d = sdf1.parse(wdContext.currentContextElement().getDateClicked());
    Regards,
    Gary

    Hi,
    If I understood you right you need this date typed as a java.sql.Date?
    String ds=wdContext.currentContextElement().getDateClicked();
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");     
    java.sql.Date sd = new java.sql.Date(sdf.parse(ds).getTime());
    Four remarks:
    We "transport" the Date from java.util.Date to java.sql.Date as milliseconds since January 1, 1970, 00:00:00 GMT. See contract of java.sql.Date.
    You used dd/mm/yyyy instead of dd/MM/yyyy, but mm are the minutes and not the months, see the contract of [SimpleDateFormat|http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html] (JSE 1.4) .
    You do not set the time zone for DateFormat, so you use TimeZone.getDefault(). This is your JVM's default time zone and depends (if you did not change it) on your systems time zone. F.e. I live in Germany, the time zone of my system is currently MEZ (which is UTC+1) since we left the daylight saving time zone last sunday. Since you only parse the date and not the time zone f.e., you expect the date (the string) to be in your default time zone. If this is not the case, you have to set the time zone to the time zone you expect the date to be in (f.e. sdf1.setTimeZone(TimeZone.getTimeZone("UTC"));) before parsing the date. This might seem marginal in your case, but may produce unexpected results with date comparisons and date parsings around the day change.
    SimpleDateFormat is not thread-safe, so please do not cache it! This is not mentioned in the Javadoc of JSE 1.4, but can be looked up at [Sun's bug database|http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=96669461418011fffffffffb70dd6b6e88eb5?bug_id=4264153]. If you are not satisfied with the standard Date & Time handling (f.e. performance reasons) you might want to consider an alternative like [Joda Time|http://joda-time.sourceforge.net/index.html] which is published under [ASF 2.0 license|http://joda-time.sourceforge.net/license.html]
    Best regards,
    Fabian

  • How to convert a number to FLOAT with 9 decimal values.

    Hi all,
    I need to convert a number like '10.02' to a floating point number with 9 decimal values like '10.022111221'. I think that the right function is TO_BINARY_FLOAT, but how can I obtain 9 decimal values? If I use the following syntax:
    select TO_BINARY_FLOAT(num) from table
    I obtain a floating point values with a variable number of decimal numbers after the ".", instead I need 9 number after ".".
    Regards,
    Maurizio.

    Hi,
    the number I need to select is the result of a product, for example:
    select (Num_A * Num_B) from Table;
    Num_A has 2 decimal numbers, like 12.01 and Num_B could be: 12.111111111.
    Now, Num_A * Num_B = 653.999999994
    but I issue:
    select TO_BINARY_FLOAT(54.00 * 12.111111111) from Table
    I obtain:
    654, a rounded value, but I need 653.999999994.

  • How to convert String (dd-MMM-yyyy) to oracle.jbo.domain.Date

    Hi
    Could you please tell how do I convert String of date in format dd-MM-yyyy to ADF date? Please show me some sample.
    Thanks

    http://javaalmanac.com/egs/java.text/FormatDateDef.html
    Once you have a java.util.Date you can convert it to oracle.jbo.domain.Date. (see http://www.fifkredit.com/bc4jdoc/rt/oracle/jbo/domain/Date.html)

  • How to convert string to date

    HI Everyone,
    i am trying to convert a date which is in string format to a date format...but i am having this error
    javax.servlet.ServletException: Unparseable date: "2004-05-03"
    Can anyone help?
    Here is a piece of code :-
    SimpleDateFormat formatter= new SimpleDateFormat ("yyyy-mm-dd");
    Date today = formatter.parse(fulldate);

    You need to change your formatting string to: "yyyy-MM-dd" Lower case 'm' is for minutes...

  • How to convert String date to java sql date

    I have an html form for entering the Date on retreving that value in a java servlet i get it as a string i want to convert that date to SQL date format so that i could use setDate() method of the java.sql.Date class to update the date value in the database.
    i used the following way but i need the code without using the deprecated ones.
    String delDate = (String)p_Request.getParameter("deleteDate");
    [b]java.util.Date utilDate = new java.util.Date(delDate);
    java.sql.Date deleteDate = new java.sql.Date(utilDate.getTime());
    custCode = (String)p_Request.getValue("custCode");
    thanx in advance.

    Check out the later posts in http://forum.java.sun.com/thread.jspa?threadID=647681&messageID=3814745#3814745

  • How to convert string into date datatype

    hi! there
    i've a date in string format like MM/dd/yyyy
    eg:String sDate = "01/30/2002";
    and i want to convert this string format into java date format
    same as 01/30/2002 only
    when i write like this
    SimpleDateFormat formatter = new SimpleDateFormat ("MM/dd/yyyy");
              String sDate = "1/11/2002";
              java.util.Date oDate = formatter.parse(sDate);
    i'm getting the output
    Fri Jan 11 00:00:00 GMT+05:30 2002
    i just want the out put like 01/30/2002
    plz,help me

    Hi,
    Just use back the SimpleDateFormat object you defined.
    String myDateInStr = formatter.format(oDate);
    this will format a java.util.Date object to a string representation according to the format you specified in the instantiation of SimpleDateFormat object.

  • How to convert a number stored as text to as integer with formating

    Hi,
    Can someone say me how to convert a Numeric data that is stored in a Varchar column to an integer.
    Say, I have a Value "-.84566666" in a column which is of data type VARCHAR and I want to show this data as "-0.8456", i.e. I want to display it as an Interger after formating it to have only 4 decimal place value etc.
    Is there any inbuilt function in oracle for this?
    Thanks,

    Take a look at builtin TO_NUMBER / TO_CHAR functions.
    SELECT TO_CHAR(TO_NUMBER('-.84566666'), 'SD9999')
      FROM dual;C.

  • Help to read a table with data source and convert time stamp

    Hi Gurus,
      I have a req and need to write a ABAP prog. As soon as i excute ABAP program it should ask me enter a data source name, then my ABAP prog has excute teh code, in ABAP code i have to read a table with this data source as key, sort time stamp from table and should display the data source and time stamp as output.
    As follows:
    Enter Data Source Name: 
    Then user enters : 2lis_11_vahdr
    Then out put should be "Data source  :"  10-15-2008.
    The time stamp format in table is 20,050,126,031,520 (YYYYMMDDhhmmss). I have to display as 05-26-2005. Any help would be apprciated.
    Thanks,
    Ram

    Hi Jayanthi Babu Peruri,
    I tried to extract YEAR, MONTH, DAY separately and using
    EDIT MASK written it.
    Definitely there will be some STANDARD CONVERSION ROUTINE will be there. But no idea about it.
    DATA : V_TS      TYPE TIMESTAMP,
           V_TS_T    TYPE CHAR16,
           V_YYYY    TYPE CHAR04,
           V_MM      TYPE CHAR02,
           V_DD      TYPE CHAR02.
    START-OF-SELECTION.
      GET TIME STAMP FIELD V_TS.
      V_TS_T = V_TS.
      CONDENSE V_TS_T.
      V_YYYY = V_TS_T.
      V_MM   = V_TS_T+4(2).
      V_DD   = V_TS_T+6(2).
      V_TS_T(2) = V_MM.
      V_TS_T+2(2) = V_DD.
      V_TS_T+4(4) = V_YYYY.
      SKIP 10.
      WRITE : /10 V_TS," USING EDIT MASK '____-__-________'.
              /10 V_YYYY,
              /10 V_MM,
              /10 V_DD,
              /10 V_TS_T USING EDIT MASK '__-__-__________'.
    If you want DATE alone, just declare the length of V_TS_T as 10.
    Regards,
    R.Nagarajan.
    We can -

  • Updating an oracle table with data from an xml string

    Hi - I need help with the following problem:
    We have a table in the database with a field of xml type. We are going to take each string that gets inserted into the xml type field in the 'xml table' and parse the data into another oracle table with corresponding fields for every element.
    once the record gets inserted into the 'real table' the user might want to update this record they will then insert another record into the 'xml table' indicating an update(with a flag) and then we need to update the 'real table' with the updated values that have been sent in.
    The problem that I am having is that I do not know how to create this update statement that will tell me which fields of the table need to be updated.(only the fields that need to be updated will be in the xml string in the 'xml table').
    Please help me with this - ASAP!

    Are you wanting to upload the file through an Oracle Form or just upload a file? If it isn't via forms, then you should probably post your question here: {forum:id=732}
    You also should post the version of Forms, Database, etc...
    As far as uploading files via a text file, I personally like to use Oracle External Tables even in Forms. You can Google that and there is plenty of information. If you search this forum, then you will see lots of people use UTL_FILE in forms, but you can Google that also for more information.

  • How to convert String to date ? - MS access

    I want to convert a string "10-10-08" [ MM-dd-yy ] into date type in same format to use that in query statement [MS Access].
    In table , I am using field called "date" with "MM-dd-yy" format.
    Example:
    <%@ page import= "java.sql.*"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <%@ page import="java.util.Date"%>
    <%
    String d="10-9-08";
         SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yy");
              Date date = dateFormat.parse(d);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
         Statement st = con.createStatement();
    ResultSet rs=st.executeQuery("Select * from datacollectdb where date='"+date+"'");
    %>
    I am getting "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    " error.
    How to use the string "10-10-08" in where statement?

    sangee wrote:
    I want to convert a string "10-10-08" [ MM-dd-yy ] into date type in same format to use that in query statement [MS Access].
    In table , I am using field called "date" with "MM-dd-yy" format.I think a column named "date" is a very bad idea. Not just because "date" is a keyword. It's not very self-describing. How about "birth_date" or "hire_date" or "went_on_my_first_date"?
    Example:Scriptlets? There's your second mistake.
    <%@ page import= "java.sql.*"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <%@ page import="java.util.Date"%>
    <%
    String d="10-9-08";The way you're doing things, "2-40-99" is a valid date. Is that what you want?
         SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yy");
              Date date = dateFormat.parse(d);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");Wrong again. Better to use a PreparedStatement and bind that Date.
         Statement st = con.createStatement();
    ResultSet rs=st.executeQuery("Select * from datacollectdb where date='"+date+"'");
    %>
    I am getting "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    " error.
    How to use the string "10-10-08" in where statement?Use PreparedStatement and bind.
    Your JSP should not be getting a database connection. Pool it.
    Your code is wrong on every level. You don't close resources, you don't separate you app into layers, your database code is not in a POJO. I'd recommend that you throw this away and start again.
    %

  • How to convert string to date and check date difference in filter clause | error in filter clause

    Hi All,
    I have a requirement where i want to stop replicat if particular record is encountered on target.
    if PARAMETER_CODE="APPLDATE" and difference between parameter_value is 1 then replicat should stop.
    the code i am using is,
    map schema.src_tablename , target schema.trg_tablename, &
    WHERE(PARAMETER_CODE="APPLDATE"), &
    filter (on updates, (@to_date(before.PARAMETER_VALUE,'dd/mm/yyyy hh24:mi:ss')) - (@to_date(PARAMETER_VALUE,'dd/mm/yyyy hh24:mi:ss')) =1), &
    EVENTACTIONS(STOP);
    Replicat process abends with error in filter clause.
    Concern here is the parameter_value column is in varchar2 and not in date. (if its date than filter (on updates, @datediff ("DD",before.PARAMETER_VALUE, PARAMETER_VALUE) =1)  is working correctly). I need to stop replicat when date(in varchar2 format) gets incremented by 1.
    Please do help in solving the issue.
    Thanks,
    TrushB.

    Dear all,
    Please do update... how to covert a varchar2 to date in GG.

Maybe you are looking for

  • HT1386 windows is not recognizing my device

    hi there, I am trying to plug in my ipod touch using the usb to the computer, and it chargers at first, then stops.    Can someone help with this program or should i just take the product back? Thank you

  • Does anyone know how to get Google Spider to read a JSF ADF web site???

    This is a re-post, but we really need help here. We've created a great Internet site using JDeveloper and JSF (www.sidehire.com), but the Google spider cannot read the site or index it. This is hurting our business because customers can not find our

  • Mapping error MAPPING_DURING_EXECUTE

    HI I am getting a mapping error in sxmb_moni. My mapping object in IR is Source structure MT_INPUT_GL dt_gl   doctype    o to unound   docdate    o to unbound Destination structure MT_OUTPUT_GL DT_GL_OUTPUT 1 to 1   doctype    o to unound   docdate  

  • HT1918 Dear I am not be abloe to find  (select payment method as "None" in iTunes)

    Dear, update your name, billing address, or payment information, follow these instructions:  From the Apple Account Information page, click the Edit Payment Information button. Edit the information that you would like to change.  Note: The payment me

  • Font texture plug-in or program? (Seeking Advice)

    Can anyone tell me some of the leading "Font texture" programs? I'm talking about the plug-ins or programs that would take your text and apply cool textures to it. And not just a silly one, but a leading industry one. We used one in college, but for