Essbase substitution variable used for SQL Dimension load-URGENT

Hi All,
I am creating one dimension through SQL Dimension load rule writing by parent child build rule. The SQL query is like below---
distinct trim(dist_mobile),trim(ret_mobile) from dist_retailer al1 where al1.proc_dt=to_date(&Proc_date,'dd/mm/yyyy')
When I fixed the value of proc_date (e.g.- '27/09/2008') then it is retrieving data properly, but when I try to make the same as a essbase variable as shown above (to give user the priviledge to select for which date data will be fetched from RDBMS to create the dim) and after setting the aforesaid value of that variable in essbase subs var screen and click 'OK/Retrieve' in rule,it is returning no rows executing the query as well as no error coming.
I guess in query nothing is wrong but the subs variable part is not working. Can anybody please give some insight to resolve the problem.
In this context, I would like to mention that I will have to use substitution variable in some other rule file also to automate the load process. How can I use essbase subs variable in SQL load rule? Could you please show me a proper summarise query illustrating how to use the subs var in aforesaid purpose for the sake of understanding?
Thanks in advance.

Hi,
Sorry for delayed response. Appreciate your inputs. At last I have found out the solution which is as below----
distinct trim(dist_mobile),trim(ret_mobile) from dist_retailer al1 where al1.proc_dt=to_date('&Proc_Dt','dd/mm/yyyy')
after setting the substitution variable as Proc_Dt and set the value as 27/09/2008 (without any quotation mark or such sign) now I checked and now it is retrieving fine.
Thanks & Regards.

Similar Messages

  • Use of Essbase substitution variables in filename of a MaxL report script

    Hey guys.
    Is there a way that I can embed the value of one or more Essbase substitution variables in the filename of a report script in a MaxL command?
    I'm running a report script that uses sub. vars for entities and accounts and based on which of those members are set in the variables I want the filenames to include those member names. I'm looking for a way to include the &varName in the filename using the export database command.
    THANKS!

    Not really.
    If you want to do a lot of string mangling in a script outside of the report script, you can use DISPLAY VARIABLE:
    MAXL> display variable CurMo;
    application         database            variable            value
    +-------------------+-------------------+-------------------+-------------------
                                             CurMo               MayRegards,
    Robb Salzmann

  • How to get essbase substitution variable in ODI

    Hi All,
    I have a problem that I need to get the substitution variable from Essbase /EAS to work on some SQL statement in ODI.
    How can I do in ODI ???
    Thanks for all ..
    Thomas

    Hi,
    If you read my blog post :- http://john-goodwin.blogspot.com/2009/11/odi-series-planning-11113-enhancements.html
    In the post there is a section on retrieving essbase substitution variables and using them in ODI.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Is it possible to read Essbase Substitution variables from ODI?

    Is it possible to read Essbase Substitution variables from ODI?

    Hi,
    You can do it with custom code, if you have a read of a blog I wrote :- http://john-goodwin.blogspot.com/2009/11/odi-series-planning-11113-enhancements.html
    About half way through I go into reading essbase sub vars using the essbase java API.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Can DBMS_ADVISOR package be used for SQL Tuning Advisor ?

    Can DBMS_ADVISOR package be used for SQL Tuning Advisor ?

    SQL> SELECT * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production

  • 11.1.1.6.11  /  Essbase Substitution Variables / RPD Init Block / Dynamic Variables

    11.1.1.6.11  /  Essbase Substitution Variables / RPD Init Block / Dynamic Variables
    How do I update the Init Block which is populated with the Essbase Substitution variables.   This is dynamically created the first time I import an Essbase cube and is populated with the Substitution variables when it is first imported into the RPD.   If later on new Substitution variables are added, they are not being reflected in the Init Block or its dynamic variables.  I have done the re-import of the data source with no change to the Init Block Dynamic Variables.   How do I get these new Substitution variables imported?
    It appears that the only way is to delete it from the Physical Layer, however this deletes any changes I have made to Cube in the physical layer.

    So delete it from the Physical Layer, change the Substitution Variables associated with the cube.   Import it back into the physical layer.   It does NOT delete existing Init Block Dynamic variables that no longer exist as Substitution variables.  

  • Using an essbase substitution variable in dataexport command in a BR

    Hi,
    I have created a calc script to export data using DATAEXPORT, and to define the filename an essbase variable.
    Here all right
    I copy this code to a business rules to run it from a business rules, but I have a problem with the essbase variable, when I validate it, it gives me the error:
    Detail:Encountered "&FileNm" at line 28, column 26.
    Was expecting:
    My essbase variable is set to:
    "e:\Hyperion\products\Essbase\EssbaseServer\app\TMPGB\dataexportCustomerY2.txt"
    in double quote
    How anyone use in a Business rules with the command dataexport an essbase substitution variable

    So it works in a calc script and not a BR, I know BR's sometimes don't always act exactly the same as calc scripts and you occassionally hit issues like this.
    What version are you using because I have a feeling I have tested this in the past and I am sure it worked.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Substitution variable using in rules file

    Hi,
    I have a requirement to load the data only for the current month. But, my source file is having data for all the months till current month.
    ex: I have to load data for MAY. But, source file is having data from JAN to MAY
    Its a monthly process and it should load the data only for the current month using substitution variable.
    Means next month I will be having JAN to JUN data. But, I should load only JUN data.
    Could any one help in building rules file for this requirement.
    Thanks
    Sri

    Is the data coming from SQL or a flat file?  And is JAN through MAY represented in multiple columns or multiple rows?
    As Evgeniy says if it's a SQL source, you can use a subvar in the SQL statement.  If it's a flat file (and your periods appear as multiple rows) you can use a subvar in a SELECT/REJECT criteria.
    Honestly though, if a feeding system is producing a flat file for you, I would try and arrange to have the flat file contain only the data that is actually required.  Parsing a file that is up to 12 times larger than necessary is inefficient.

  • Substitution Variable in Cross Referencing dimensions

    Hi All,
    Can we use substitution variable for cross referencing dimensions.
    Example:
    "Region" = &currmth->&curryear->"New York";
    Thanks in Advance
    Bal.

    Hi John,
    If I use substition variable the answer/value for 'DOM' comes vague. If I hardcode the variables, the values for 'DOM' it comes perfect/accurate.
    Can you please help sir ?
    The Calc script is (Hardcoded value are Sep, FY09,Budget)
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    SET CACHE HIGH;
    SET LOCKBLOCK HIGH;
    SET AGGMISSG OFF;
    SET UPDATECALC ON;
    SET CREATEBLOCKONEQ ON;
    /* Material Expenses Allocation */
    FIX(&xscenario,&xyear,&xmonth,"NoLocation","NoModel",&xversion,@LEVMBRS("KD PARTS TOTAL",0),@LEVMBRS("VEHICLES",0))
    "DOM" = ("Sep"->"FY09"->"Budget"->"NoRegion"->"InputVersion") * ("Indigenous component cost-Domestic-%"->"REGION"->"ENTITY"->"Budget"->"Sep"->"LOCATION"->"MODEL"->"FY09"->"InputVersion")/100;
    ENDFIX
    Many Many thanks in advance.
    Bal

  • Essbase Substitution Variables

    Hi All,
    I went through the docs. but not able to find an answer to the following query.
    What is the maximum number of substitution variable that we can create for an application??
    We use nearly 30 variables for a application to handle security. So i wanted to know whether there is a limit for the variables?
    Your inputs would be of great help. Thanks!!

    I can tell you in my 12 years with Essbase, I have never heard of anyone having issues using as many subvars as they need. Your best bet is to just go ahead and just try them out. To create them should not take much time at all.
    John Conlee
    Oracle Practice Manager - Analytic Vision

  • Setting Essbase substitution variable thru ODI

    Hello Friends,
    We have some procedures in ODI that call maxl scripts to unlock app, clear data and agg. But how do we set Substitution variable in Essbase?
    Any feedbacks are appreciate...
    Thank You.

    Thanks John.
    - We created a maxl script with the statement below
    alter system set variable 'ActMon' 'Feb';
    - Created a procedure in ODI to call the maxl
    the procedure is working...but we still have to manually edit the maxl script every month to change the current month value.
    How about this?
    We have a oracle table in ODI schema which has month column populated. can we use that month column data and some how set the Essbase Sub var?

  • The SQL Server Management Studio used for SQL 2012

    Hi,
    Wanted to confirm is SQL Server Management Studio 2008 compatible client for
    SQL server 2012, or does the client come packaged with the SQL 2012

    Related thread:
    http://stackoverflow.com/questions/12136005/sql-server-management-studio-2008-connects-to-sql-2012-localdb
    SQL Server 2012 client tools include SSMS 2012 version.
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • What book to use for SQL certification?

    I'd like to know what do you recommend me to study best:
    Course ID: D47359, Oracle Database 10g: SQL Fundamentals Self-Study CD Course Self-Study CD-ROM
    or
    Course ID: D20964 Introduction to Oracle9i: SQL Self-Study CD Course Self-Study CD-ROM
    for SQL certification. I have many years of experiences in Oracle SQL (SQLplus, PLSQL, forms, reports), but I think I'm weak on tricks and tips and on the last new syntaks.
    Thanks!
    m.

    IMHO
    Course ID: D47359, Oracle Database 10g: SQL Fundamentals Self-Study CD Course Self-Study CD-ROM is better as 10g is latest version.

  • Essbase substitution variable for memebr with '-' in name

    I am trying to do subjected assignment. I have a member with '-' in name and trying to assign it to sub.var.
    It let me do it in EAS (hit set and it went OK), but not in Maxl--it says syntax error near '-'
    Also it is giving me wired errors while validating calc script with this var.
    Any idea ?
    Thanks

    If the value of the subvar is encased in quotes, you don't need to quote it in the fix statement.
    &subvar.
    Robert

  • Declaring variable using Dynamic SQL

    Hi guys,
    I need to declare a variable base on a result.
    <snipplet>
    DECLARE
    v_objname VARCHAR2(50);
    BEGIN
    SELECT OBJECT_NAME
    INTO v_objname
    FROM USER_OBJECTS
    WHERE OBJECT_ID = 'xxx'
    AND OBJECt_TYPE = 'TABLE';
    -- now i need to declare a rowtype variable base on the objname
    -- e.g v_rowname v_objname%ROWTYPE;
    </snipplet>
    q1) May i know how do i do that ?
    Regards,
    Noob

    This sounds like a precursor to building a "generic" piece of code. As Boneist says... Bad Idea.
    If dynamically generated queries really need to be written (justify why first!) and you're not sure of the columns that are going to be returned, then you would preferably use the DBMS_SQL package to build the query and use positional notation to obtain the data from the dynamic columns, using the describe ability of dbms_sql to get information on the column types etc.
    e.g.
    (From my standard answers...)
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.
    I have never found any need, ever* to have to write dynamic PL/SQL code. It just shouldn't be necessary. If you're finding yourself heading in that direction, seriously take a step back and re-consider your design and what it actually is you're trying to achieve. There almost always will be a better way.

Maybe you are looking for