Substitution variable - Problem

The requirement is to have numeric value to a substitution variable. In essbase there is a provision to set numeric value to a substitution variable . i tried out the below one its not working.
Create a sub variable and assigned value "12" and tried using the same sub variable in the MDX query but getting error. kindly let me know is it possible to set a numeric value to a sub variable and use the same in MDX formula. Any help would be greatly appreciated.
I have seen this note in dbag :
If a substitution variable value is numeric, different rules apply for how you enter the variable:
If it is not used in MDX statements, enclose a substitution variable value in quotation marks; for example, if the variable name is Month, and its corresponding value is 01 (corresponding to January), place quotation marks around 01 (“01”). Substitution variables usually are used with block storage databases; they are not used in MDX statements.
If it is used in MDX statements only, such as in formulas in aggregate storage outlines, and the value is numeric or a member name, do not enclose the value in quotation marks.
Note:
If a substitution variable value is numeric or a member name starting with a numeral or containing the special characters referred to above is to be used both in MDX and non-MDX situations, create two substitution variables, one without the value enclosed in quotation marks and one with the value in quotation marks.

i got the way to do

Similar Messages

  • Substitution Variable problem in member formula

    I'm using the following member formula for a member in a sparse dimension - Scenario.
    @VAR("Actual",&PO_PriorLE->"Final");
    I can get this to validate in Essbase, but when I try putting it into Planning, the refresh to Essbase bombs and the formula will not validate in Planning.
    Version - 9.3.1
    Thoughts?
    Regards,
    Paul
    Edited by: penglish on May 27, 2009 3:20 PM

    Hi,
    I have just tried it on 9.3.1 patch 10 and had no problems.
    I take it the member assigned to &PO_PriorLE already exists ?
    Have you tried replacing the substitution var for the real member name in the formula.
    What is the error message when you try and validate?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problems using substitution variable in Web Analysis

    Dear all,
    I have a Web Analysis report that I need to show a raking table with the current month.
    For that I create a variable in Essbase that is updated with that date (E.g.: varCurrentMonth).
    After that I use it as my substitution variable to filter my date dimension in a report data source (E.g.: Scr5, row: product, column: date dimension & measure):
    2008 (current month)
    Product $ qty.
    AAA 100 10
    BBB 90 7
    CCC 80 5
    The problem is that in our cube we need to use an alias in every dimension not to have duplicate members (E.g.: DT.Date, MS.Measure, PD.Product, etc). And when we use it we need to set up the variable in Essbase using that alias (E.g.: DT.Feb/05/08). And if we use that variable as a substitution variable in the report data source the label displayed is the DT.2008 and not 2008 as expected.
    Does anybody have an idea how to solve that?
    Many thanks,
    Thiago Gabriel

    You usually get this error message if you are trying to assign a value from a sub var to a member that does not exist.
    e.g. trying to put FY08 which is a year member against a period dimension
    or trying to use a sub var of FY09 which does not yet exist in the essbase, so say you added a new year in planning FY09 and used the sub var in the form but have not refreshed the database then it would fail because the year would not have been pushed down to essbase yet.
    or the value of the subvar does not match a member name exactly
    or using a sub var name that does not exist in essbase, e.g. using &nextYear but the sub var has not been created in essbase.
    You can definitely use subsitution variables in columns in the version you are using and prior version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Peculiar problem with Essbase (Calc Script) - substitution variable / UDAs

    This is odd but I have a script like :
    VAR iloop=1,break=0;
    FIX(<required POV>)
    Loop (20,break)
    VAR Country_total1,Country_total2,Country_total3;
    FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop)))) // &Country1, &Country2 - are substitution variables with UDAs stored as strings
    Statements;
    /* +<statements for calculating total values.. for that country and stored against variables>+ */
    Country_total1=Country_total1+ +<Calculation>+
    ENDFIX
    /* Second part : Now again the calculations stored in the variables are to be stored against specific entities */
    FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop))))
    FIX(@ISUDA(Entity,<Check1>)
    ..... Assign to relevant account
    ENDFIX
    ENDFIX
    ENDLOOP
    ENDFIX
    Now the problem is that the first fix statement works just fine, but the FIX statement in the 'second part' throws an error
    Error: 1200354 Error parsing formula for [FIX STATEMENT] (line 66): expected type [STRING] found [EXTVAR] ([iloop]) in function [@CONCATENATE]
    If I hard code the 'second part' FIX statement to the substitution variable directly - it works just fine.
    How can the first statement work and not the second one ? They are exactly the same.

    Glenn, thanks - I hadn't thought of that :).
    But it still does not entirely solve my problem (please see my previous post depicting a requirement similar to ours )
    - We have lots of countries (50-60+ might be much more) and each country can have multiple entities (3-4 on an average - can go unto 7-8)
    - so good guess would be around 200 entities
    - So say I have to do it for 2 countries only (two entity types). Then I need 4 variables - 2 for each country ('country 1 ET1 total', 'Country 1 ET2 Total')
    When the list is 20 counties - variables become 40 :(.
    - Still leaving aside the 40 variables for a bit -
    There are subsequent steps of calculations which needs to be done based on these totals (which are exactly the same for all countries) - just that we need the correct totals to begin with and the rest is already stored in the DB
    So since I have a different variable for each country - I cannot write one single calculation block to use the variables sequentially one by one (can I ?)
    I might have to write a separate calculation block for each of these countries. (20 separate blocks)
    That's what I was trying to avoid and simplify with the substitution variable (but is not working)
    - Create substitution variables - which would store the alias of the required countries (2/10/20 as many required)
    - Loop through these substitution variables - using them one by one
    - So I just need one single block of calculation with all the variable in the calc script being reused after each country calculation is done
    - and the user need not go into the script, as the only thing that will change are the countries. And he can change it easily through the substitution variable.
    Edited by: Ankur on Jun 27, 2012 12:53 PM

  • Problem in taking correct Substitution variable in MDX Formula

    Hi,
    We have MDX Formula which takes Substitution Variable as input . Previously we used Hyperion Essbase 9.3.1.3 version and working fine currently we upgraded to 11.1.1.3 version After Upgrade this formula is not taking correct updated value. Its taking previously updated value . To Take the Correct value we are bouncing the Essbase Services then only new Formula is picking the latest Updated value. This is happening only for one formula and rest everything is working fine. Can you please tell us is there any bug or where is the problem is ?
    Thanks,
    Naresh.

    The Database Administrator's Guide and the Essbase Technical Reference are available through the documentation portal:
    http://download.oracle.com/docs/cd/E17236_01/nav/portal_3.htm
    Both the Database Administrator's Guide and the Technical Reference are searchable on an exact phrase, to find the source of the extract John provided.
    http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_dbag/dotcreat.html#dotcreat1053369
    See section "Setting Substition Variables".

  • Problem with my substitution variable.

    My substitution variables don't prompt properly now. It worked fine before, but I don't know what I did to it. Here is the test code:
    set define on;
    connect sys/&sysPassword @&instanceName as sysdba;
    execute dbms_output.put_line('this is a test');
    When I tried to execute above lines in sqlplus, it didn't prompt anything, but got following result instead:
    SQL> set define on;
    SQL> connect sys/&sysPassword@&instanceName as sysdba;
    Enter value for syspassword: execute dbms_output.put_line('this is a test');
    Enter value for instancename:
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SQL>
    I remember when I used substitution variables before in sqlplus worksheet, it popup a dialog for input, but it doesn't anymore.
    Any ideas about this issue? Or what setting could affect the behavior? Thanks in advance.

    It would work only if you put these set of statements in a .SQL file and run that file at SQL*Plus prompt:
    SQL> @the_sql_script_created_above.SQL

  • SQLPlus problem - user enters quote in substitution variable

    Hello,
    I have a SQL Plus script report, where user is prompted to enter "customer name".
    Some customer names contain single quotes/apostrophes.
    When user type such name, the script will error out with
    ORA-01756: quoted string not properly terminated
    I can't ask users to use '' instead of ' . I can't control what they enter. Is there a way to process single quote so the statement below will work:
    select * from sometable where customer_name = '&1'
    where &1 = Smith's
    I can't do replace, etc, because it's all error out with the same error. I need to replace ' on SQLPlus level somehow. One logical way to do it would be to redefine the string separation charachter somehow...
    SQL*Plus: Release 8.0.6.0.0
    Thanks,
    Vlad
    Message was edited by:
    user454392

    As it's a SQL*Plus substitution variable it is literally copied into the code just prior to compilation, so you can't stop it from breaking the compilation of the code. q quoted strings are the only solution I can think of but of course they are only available from 10g onwards.
    The other alternative is to capture the input in a shell/batch script which validates it first and then passes the value to the SQL to be executed.

  • Problem setting the value of a substitution variable in a calc script

    Hi, All.
    I'm trying to update the value of a substitution variable inside an IF statement and I'm having trouble.
    Here's the code:
    *"Jan"(*
    IF  (LoopCounter = 1) &varEntity = "100";
    ENDIF;)
    the error I get back from EAS is:
    Error: 1200336 Error parsing formula for [Jan] (line 54): [(] without [)]

    I know CL knows a lot about HBR, if he's around today... LOL
    As a matter of fact, I just used an HBR (not using Calc Manager till I have to)'s macro functionality to drive fx for different Scenarios in a Planning app. Here's how I call the macro:
              /*     Call the macro mcrFxCoreOutYears for the four fx rate types for ALL 12 months of the year.     */
              FIX(&BudYear)
                   %mcrFxCoreOutYears(Constant)
                   %mcrFxCoreOutYears(Comparable)
                   %mcrFxCoreOutYears(Estimate)
                   %mcrFxCoreOutYears(Actual)
              ENDFIXI pass the Scenarios Constant, Comparable, Estimate, and Actual to the macro mcrFxCoreOutYears. You can apply HBRs against Essbase.
    I believe (I can't remember what exactly -- is it that templates don't accept parameters? That seems hard to believe. Looking at a CM template, that does seem to be the case. Bummer if I'm right.) that Calc Manager BRs have less functionality wrt templates, but I haven't worked with CM for over a year.
    It works really well -- a single place to maintain code and no appreciable performance cost.
    You cannot launch a HBR from a MaxL script but HBRs can be launched from command lines -- this may constrain where you place your automation (it basically has to run off of whatever the EAS server is. You may end up shelling out of MaxL to execute the HBR or even execute scripts across servers -- that does get more complicated.).
    Anyway, if you have any more questions, ask away -- it really is a very powerful component. I will have to look at CM more closely (sooner or later I will lose the HBR vs CM argument and at least need to know if templates support parameters) to see if I'm right on what I wrote above.
    Regards,
    Cameron Lackpour
    P.S. You cannot define an ARRAY in an HBR macro because ARRAY arrayname[value] gets read as a parameter. I ended up declaring the array in the calling HBR.
    P.P.S. I really need to write up the fx approach in a blog post -- it is wicked fast and really easy to use. Too many other posts in the queue already.
    Edited by: CL on Aug 24, 2011 1:48 PM

  • Isql*plus 9.2 problem: Substitution variables

    hi, i'm new to using isql*plus.
    i have written the following script to setup my the structure of a database, it works but when i execute it it asks me to:
    Substitution Variables
    Enter values for substitution variables in the script to execute:
    Variable      Value
    d
    I cant work out why, please help.
    here's the script:
    --author: daniel smith
    --student number: 2235592
    --date: 17/02/2005
    --isql plus
    --Application Development and Database (AD&D)
    --Assessment 3
    --drop existing tables
    drop table expense;
    drop table sess;
    drop table assignment;
    drop table task;
    drop table stage;
    drop table project;
    drop table task_type;
    drop table employee;
    drop table grade;
    --create new tables
    create table grade
    grade_no number(6) primary key,
    description varchar2(50),
    rate_per_hour number(5,2)
    create table employee
    employee_no number(6) primary key,
    surname varchar2(50),
    first_name varchar2(50),
    grade_no number(6),
    foreign key (grade_no) references grade(grade_no)
    create table task_type
    task_type_no number(6) primary key,
    description varchar2(50),
    grade_no number(6),
    foreign key (grade_no) references grade(grade_no)
    create table project
    project_no number(6) primary key,
    project_code varchar2(50),
    client varchar2(50),
    description varchar2(50),
    manager number(6),
    foreign key (manager) references employee(employee_no)
    create table stage
    project_no number(6),
    stage_no number(6),
    description varchar2(50),
    Start_date date,
    planned_Duration number(6,1),
    fees_basis varchar2(2),
    primary key (project_no,stage_no),
    foreign key (project_no) references project(project_no),
    constraint fees_basis_ck check(fees_basis IN ('fq','vs','vn','cs','cn'))
    create table task
    project_no number(6),
    stage_no number(6),
    task_no number(6),
    description varchar2(50),
    estimated_hours number(6,2),
    planned_start_date date,
    max_duration number(6,2),
    task_type_no number(6),
    primary key (project_no,stage_no,task_no),
    foreign key (project_no,stage_no) references stage(project_no,stage_no),
    foreign key (task_type_no) references task_type(task_type_no)
    create table Assignment
    project_no number(6),
    stage_no number(6),
    task_no number(6),
    employee_no number(6),
    estimated_hours number(6),
    primary key (project_no,stage_no,task_no,employee_no)
    create Table Sess
    Session_no number(6),
    Session_date date,
    actual_Hours number(6),
    chargeable char(1),
    project_no number(6),
    stage_no number(6),
    task_no number(6),
    employee_no number(6),
    primary key (Session_no),
    Foreign key (project_no, stage_no, task_no, employee_no)
    references Assignment(project_no, stage_no, task_no, employee_no),
    constraint chargeable_sess check(chargeable IN ('y','n'))
    create table expense
    expense_no number(6),
    description varchar2(50),
    quantity number(4),
    unit_cost number(4,2),
    chargeable char(1),
    project_no number(6),
    primary key(expense_no),
    foreign key(project_no) references project(project_no),
    constraint chargeable_exp check(chargeable IN ('y','n'))
    **********************************************************

    << ..
    << --Application Development and Database (AD&D)
    << --
    take the '&' off your script,
    oracle thinks you want to define variable D,
    and obviously you don't want that

  • Error When Prompting for Substitution Variable

    Hi - I'm receiving an error when I try to run the following using the substitution variable - but only when I enter a string; when I enter a numeric value it runs fine.
    DECLARE
        l_SCR_Info            VARCHAR2(50) := '''SCR'||&SCR_NUM||'-'||'''';
    begin
    dbms_output.put_line(l_SCR_Info);
    end;Here is the error I receive when I supply a string value when prompted:
    ORA-06550: line 3, column 52:
    PLS-00201: identifier 'AB' must be declared
    ORA-06550: line 3, column 27:
    PL/SQL: Item ignored
    ORA-06550: line 10, column 22:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 10, column 1:
    PL/SQL: Statement ignoredCan anyone shed some light on what I'm missing here?
    Thanks!
    Christine

    Hi,
    It looks like you just want one string there:
    l_SCR_Info            VARCHAR2(50) := '''SCR&SCR_NUM-''';Remeber how substitution variables work: SQL*Plus replaces them with values before sending the code to the back end to be compiled.
    If you give a value like AB for the variable, the code you posted is equivalent to:
         l_SCR_Info            VARCHAR2(50) := '''SCR'|| AB ||'-'||'''';by the time it reaches the compiler. AB is not inside quotes, so the compiler looks for a variable or function called AB.
    If you gave a number:
         l_SCR_Info            VARCHAR2(50) := '''SCR'|| 123 ||'-'||'''';there's no problem; the compile knows what the literal number 123 is.

  • Using substitution variable in sql -- Issue

    Hello All
    I am trying to do a sql operation from command prompt of my system and that sql requires substitution variable which i am passing it but when i pass the variable ( there are two) the first one assign as " \c" and second gets both what i am passing.
    I am not sure what exactly happening here, i have done this on AIX but here its not working any ideas?
    System : uname -a
    Linux ## 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

    AIX and Linux are not the same. An output of "\c" may indicate a compatibility issue of your shell script with your current command line interpreter (shell). A \c can be used to suppress a newline with the echo command. Bash understands both formats echo -n and echo \c, but other shells like Ksh don't. Try to run your script under a Bash, which is the default under Linux. If the problem persists you will need to post your script for any further analysis.

  • Error with define substitution variable in SQL

    Hi there,
    I am using PL/SQL developer and trying to define a substitution variable as follows:
    define freq = 'Weekly'
    Then later on, in my SQL statement, I used this variable in WHERE statement as follows:
    WHERE ... (&freq = 'Weekly') and ...
    But I got the "ORA-00904: "WEEKLY": invalid identifier" error.
    Where is the problem?
    Thanks in advance!

    I don't know about PL/SQL developer but in sqlplus you need single quotes around the variable.
    SQL> define freq = 'Weekly'
    SQL> select null from dual
      2  where &freq = 'Weekly';
    old   2: where &freq = 'Weekly'
    new   2: where Weekly = 'Weekly'
    where Weekly = 'Weekly'
    ERROR at line 2:
    ORA-00904: "WEEKLY": invalid identifier
    SQL> edi
    Wrote file afiedt.sql
      1  select null from dual
      2* where '&freq' = 'Weekly'
    SQL> /
    old   2: where '&freq' = 'Weekly'
    new   2: where 'Weekly' = 'Weekly'
    N
    SQL>

  • Substitution Variable in WA error

    Hi there,
    We have moved our server's IP beacuse we promoted developement (server07) to production (server08). Prior to that all reports worked fine. Now we're having some problems with the Substitution Variables, because everytime we select them, to include them in a report, it displays the following error:
    *"Actual_Month is not a valid substitution variable for dimension Period"*
    In fact I've tried to create a new variable with a new name and I get the same error. What intrigues me is that if we use the same variable for Dynamic Time Series let's say Y-T-D(Actual_Month) it works and displays a value.
    Maybe is there something in the connection but still with no clue how to fix it. Any database or setting at the config file to set?
    Thanks!

    I don't know about PL/SQL developer but in sqlplus you need single quotes around the variable.
    SQL> define freq = 'Weekly'
    SQL> select null from dual
      2  where &freq = 'Weekly';
    old   2: where &freq = 'Weekly'
    new   2: where Weekly = 'Weekly'
    where Weekly = 'Weekly'
    ERROR at line 2:
    ORA-00904: "WEEKLY": invalid identifier
    SQL> edi
    Wrote file afiedt.sql
      1  select null from dual
      2* where '&freq' = 'Weekly'
    SQL> /
    old   2: where '&freq' = 'Weekly'
    new   2: where 'Weekly' = 'Weekly'
    N
    SQL>

  • Unable to execute the substitution variable in calc scripts in essbase 11.1

    Unable to execute the substitution variable in calc scripts in essbase 11.1.3
    FIX(&CURRVERSION,COLA)
    Unit=units*Listprice;
    dataexport "file" "," "E:\NEW.TXT";
    ENDFIX
    Error: 1200471 Error parsing formula for FIX STATEMENT (line 1): expression expected before [)]
    This is error it throws when executing the calculation script
    I wonder whether its a problem with substitution variable i want to know wat went wrong inside the fix statement
    I have created substitution variable use maxl
    Installed the essbase in custom manner and standlone mode nt register with the shared services ,
    Is this problem with the custom installation of essbase
    Regards
    shenna

    If you remove the substitution variable and replace it with the actual value (whatever that is), does the code work? That will tell you if the issue is around the substitution variable or not.
    John -- First you race Glenn, then you race me -- and you always win. :)
    Regards,
    Cameron Lackpour

  • Financial Reporting and substitution variable

    Hello,
    i have a problem with FR and substitution variable. I create the substitution variable in Essbase for example antYear but i dont'see in dimension layout in FR studio and workspace.
    Thanks.

    You'll need to restart FR studio, after you have created the substitution variables. As the studio only performs one read of the sub var database on startup.
    It also won't show up unless you assign a member to it.
    Hope this helps.
    Iain

Maybe you are looking for