IF Statement with multiple ORs in Calc Script

Hello,
May I know what is the best way to script the following statement in a Member formula, not calc script (can't use Fix statements)
If (A->B->C == 1, 3 or 5 AND X->B->C == Value1)
returnvalue1
ELSE
#Missing.
Basically I am looking for syntax for an IF statement where IF one condition is equal to multiple values as mentioned, then the result is this...
Help is much appreciated.  Thanks.
Adi

You won't be able to use a comma separated list, you'll have to repeat the combination. A->B->C == 1 or A->B->C == 3 so on and so forth
If you can give a use case scenario or the logic behind it then there are more chances that you might end up with a nicer solution.
Regards
Celvin

Similar Messages

  • Help With A Case Statement With Multiple Variables

    I apologize if this is the incorrect Forum for this type of question, but it was the closest one that I could find. I'm pretty new with SQL and am stuck on this issue. I have roughly 26 dates that I need to compare to one another. Each date is tied to a step code. I also have a Stop value that is tied directly to the "max date" of the step codes. So, I need to compare 30 dates against one another to 1st - ID the max date; 2nd - ID if the Stop value is correct; 3rd - if the stop value is incorrect, identify what the correct value would be.
    At first, this seemed like it wouldn't be that hard. I wrote a query that found the max date for each step code. Then I realized that multiple step codes could have the same date. So, I tried using this case statement, but I did not get the expected results. Is there a more efficient way of getting what I need? This code seems like it's not necessary and probably the source of my issue.
    CASE
    WHEN FS25.ACTUAL_COMPLETION_DATE > FS.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS1.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS2.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS3.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS4.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS5.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS6.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS7.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS8.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS9.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS10.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS11.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS12.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS13.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS14.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS15.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS16.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS17.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS18.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS19.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS20.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS21.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS22.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS23.ACTUAL_COMPLETION_DATE AND FS25.ACTUAL_COMPLETION_DATE > FS24.ACTUAL_COMPLETION_DATE AND L.FORECLOSURE_STOP_CODE <= '8' THEN '9'
    ELSE 'UH OH'
    END AS "CHANGE FC STOP TO"
    Any assistance is appreciated!

    I think Igor pointed out a working solution before.
    Applying it at your examples (you missed the operator after STOP_CODE, I assume it =):
    CASE
    WHEN FS25 = GREATEST(FS25, FS24, FS23) AND STOP_CODE = '9' THEN '9'
    ELSE 'UH OH'
    END AS 'CHANGE STOP CODE TO'
    {code}
    Be careful at the second example. You are checking:
    {code:sql}
    FS25 > FS24 OR FS25 IS NOT NULL AND FS24 IS NULL AND FS25 > FS23
    OR
    FS25 IS NOT NULL AND FS23 IS NULL AND STOP_CODE = '9'
    {code}
    Remember that AND has higher priority among operators than OR so if FS25 is greater than FS24 and FS23 the condition will be true even if STOP_CODE is not equal 9.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need help with update statement with multiple joins

    I've got the following select statement that is pulling 29 records:
    SELECT
    PPA.PROJECT_ID,
    PPA.SEGMENT1,
    peia.expenditure_item_id,
    peia.expenditure_type,
    pec.expenditure_comment
    FROM PA.PA_PROJECTS_ALL PPA,
    pa.pa_expenditure_items_all peia,
    pa.pa_expenditure_comments pec
    where PPA.segment1 < '2008' and
    PPA.project_id = 52 and -- just run for project # 20077119 for testing
    peia.expenditure_type = 'PAYROLL' and
    peia.project_id = ppa.project_id and
    PEC.EXPENDITURE_ITEM_ID = PEIA.EXPENDITURE_ITEM_ID;
    I need to update the pec.expenditure_comments to a static field for those 29 records. I assume I should start with the following, but not sure how to complete the where:
    update
    pa.pa_expenditure_comments pec
    set pec.expenditure_comment = 'REFERENCE HD#728'
    where
    First time that we've ever needed to update, so any and all help appreciated.

    Try using exists:
    update pa.pa_expenditure_comments pec
    set    pec.expenditure_comment = 'REFERENCE HD#728'
    where exists ( select null
                   from   pa.pa_projects_all ppa
                   ,      pa.pa_expenditure_items_all peia
                   ,      pa.pa_expenditure_comments pec2
                   where  ppa.segment1 < ''    -- not sure what you posted here, so for next time:
                                               -- please put your examples between the code tags.
                   and    ppa.project_id = 52  -- just run for project # 20077119 for testing
                   and    peia.expenditure_type = 'PAYROLL'
                   and    peia.project_id = ppa.project_id
                   and    pec2.expenditure_item_id = peia.expenditure_item_id
                   and    pec2.expenditure_item_id = pec.expenditure_item_id
                 );

  • Connect statement with input string in a script

    I would like to enter a password for each connect statement after I start my.sql
    my.sql
    connect scott/&p_password@orcl;
    grant SELECT to peter on table_1;
    SQL>@my.sql
    SQL> connect scott/&p_password@orcl;
    Please enter a value for p_password: grant SELECT to peter on table_1;
    invalid option.
    using: CONNECT <username> [AS SYSDBA|SYSOPER]
    SQL> ...
    Sql accept the grant statement after the connect statement as an input value.
    What must I change in my script???
    Best regards,
    Tom Rakete
    Message was edited by:
    Tom Rakete

    Are you trying to start your script from within SQL*Plus?
    Afraid no. Because the prompt "Please enter a value for ..." sounds suspicious.
    C:\my.sql
    conn max/&p_password@pdoxora
    grant select on test to public;Copy-paste from SQL*Plus:
    SQL> @C:\my.sql
    Enter value for p_password: *******
    Connected.
    Grant succeeded.In other words, SQL*Plus prompts "Enter value", not "Please enter a value".
    So what tool are you using?
    Regards,
    Andrew.

  • Inline Calc Script Calculation

    Hello! I'm being lazy and i'd like to calculate a variable in a calc script using an inline calculation, choosing a very simple example:
    *1. VAR WEIGHT = 1;*
    works successfully, but
    *2. VAR WEIGHT=1 + 2;*
    fails with Error: 1012001 Invalid Calc Script Syntax [
    variations i've tried on *2* also fail WEIGHT = (1+2);, WEIGHT ( WEIGHT = 1+2; ); etc...
    Any ideas?
    Graeme.

    Setting a variable to a constant is fine byitself Var Weight = 1; but if you want to do math to set the varialbe it needs to be in a block statement. When you exit the block, the variable is no longer available. Try
    Var Weight;
    Weight = 1 + 2;
    "Weighted Sales = weight * sales;
    Notice the parens starting and ending the command that is the block command. Depending on what you are doing you might need to specify a member starting th command
    "Weighted Sales"(
    )

  • Run calc script via business rule

    Hello all,
    I have calc scripts and business rules in my hyperion essbase.
    one of the calc scripts e.g. aggregates some values.
    In the business rule i copied the code from the calc script and this business rule can be executed in the planning tool.
    Now, everytime when i change the code from the calc script, i have to change same things at the business rule.
    And now my question:
    Is it possible to start a calc script with the business rule?
    e.g. content of business rule: execute "calc_aggregate"
    Is there a command?
    Then it would save time and i only have to change the calc script and not both.
    Thanks for your efforts,
    Chris

    1) try to use essbase 9.3 with dataexport command in calc script (this version essbase is compatible with planning versions 9x and 4.1)
    2) you can write (or found in google) UDF function for run system command or (and) export data set
    3) you can run system command from Planning web and run CSC and RUL from essmsh
    ER

  • 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

  • Executing multiple DDL statements with OracleCommand

    hi..
    im having trouble executing multiple ddl statements with the the oracle command object. i have tried to enclose them within Begin.. End; block but with no use.
    this problem seems to occur only with DDL statements,.. as my DML like update, delete and Inserts seem to work fine when enclosed within the PL /SQL block.
    single DDL statements also seem to work fine. so im guessing this has nothing to do with priviledges. any ideas?
    my code as follows
    OracleCommand command = new OracleCommand();
    command.CommandType = CommandType.Text;
    command.CommandText = string.Format(@"{0}",script);
    conn.Open();
    command.Connection = conn;
    command.ExecuteNonQuery();
    the script is read from a file, and looks like this. (note : i have removed any line breaks or any other characters)
    BEGIN ALTER TABLE SYSTEMUSER DISABLE CONSTRAINT FK_USER_CLIENT; ALTER TRIGGER SET_SUBSCRIPTION_SUB_I DISABLE; END;
    this is the error i get.
    Oracle.DataAccess.Client.OracleException: ORA-06550: line 1, column 7:
    PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe.

    If I'm not mistaken, we're not allowed to issue DDL inside anonymoue block (or stored procedure) since DDL has implicit commit in it. But you still can execute DDL using EXECUTE IMMEDIATE or using DBMS_SQL package. Try changing your CommandText like this,
    BEGIN
       EXECUTE IMMEDIATE 'ALTER TABLE SYSTEMUSER DISABLE CONSTRAINT FK_USER_CLIENT';
       EXECUTE IMMEDIATE 'ALTER TRIGGER SET_SUBSCRIPTION_SUB_I DISABLE';
    END;Hope this helps,
    [Nur Hidayat|http://nur-hidayat.net/]

  • Calc Manager for Essbase Hangs with multiple users

    I use Calc manager to run rules directly against Essbase. My problem is when multiple users try to run rules (in separate applications). First user the rule will run immediatly, but the 2nd user will be a Launch Status box that is just blank, nothing will run for the 2nd user until the 1st users calc script is done.
    I've tried deploying all the rules (in both Apps), hoping that would fix it, but it doesn't.
    Any thought how I can make several users run at the same time?
    Chad

    Hello Chad,
    this looks strange. The users are using a different UserID ?
    You could have a look at the access rights for these users.
    They launch them from the Workspace I suppose?
    Do they use the same objects like Runtime Prompt?
    I have more experience with the Calc Manager on Planning and not directly on Essbase.
    Maybe your answers could help finding the cause.
    Regards,
    Philip Hulsebosch

  • Execute Calc script in Maxl with compained all script

    Hi,
    I have nearly 20 Calc script in one of the application. I need to run all the script once I change the calc script.
    Execute calculation default 'databasename.application-name' ;
    Is there any command in MaxL directly use to run all the calc script?
    Kindly let me know.

    I'm not sure why anyone would want to run 20 scripts. If I wanted to do that I would combine them into one or two. If your heart is set on running ALL the scripts in your database, You could do something like create a generic MaxL script like:
    Execute calculation sample.basic.$1
    then in your batch script have a statement that selects all of the files that end in .csc for the directory and pass them to the script essmsh mymaxl.mxl Filename
    I'll assume either the scripts are named in the order you want them to run or you could rename them with a numberic to indicate the run order.

  • How do you stop multiple users executing the same calc script at the same time?

    We have an issue when  users uplaod a spreadsheet and then run a calc script. at one time we have multiple exectuions of the script running.
    This slows up the system and we have to go cancel all the executions and run it again.
    Can we stop this and put them on a queue, so only one execution of the calc happens at one time. Or stop multiple executions getting submitted at all.

    You could use EXCLUSIVECALC to stop more than one calc running at the same time, although this will apply to all applications on your server.  And it doesn't just stop the same calc being launched twice.  Easier than the alternatives I can think of though, if it works for you.

  • Object with multiple states and slider in folio are rasterized, settings seem correct.

    I am having trouble keeping An object with multiple text states from being rasterized, as well as a slider that is also rastering.
    I have read that you are supposed to set the folio and article up to be .pdf and that the slider should have the vector option chosen.
    I haven't found anything for the multi state object to for these settings.
    What happens is when I output the folio to Adobe Content Viewer, only the text in those items is rasterized. All other text is crisp. Tested on both iPad Mini and iPad Retina and the both are blurry.
    Is there a way to force the vector option? It seems even with the correct options selected it is still rastering the test in interactive elements.
    Thanks!

    Here is the MSO with the folio.
    Here is the Slider with folio overlays panel.

  • C# Script to open and read an Excel spreadsheet with multiple worksheets

    Can someone provide me the C# syntax and Edit Script to open an Excel spreadsheet with multiple worksheets and then using the data to create and output a .csv file? The multiple worksheets contain different data elements that I'll need to parse out and then
    store as a .csv file that will then be read to pump data into our SQL Server Database.
    Thanks for your review and am hopeful for a reply.
    PSULionRP

    I think this code originally came from Joel, who comes here quite a bit.  I'm not a C# expert, like Joe is, but I think this is pretty close to what you want.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    using Microsoft.Office.Interop.Excel;
    using System.IO;
    namespace WindowsFormsApplication2
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Main();
    public void Main()
    string filePath = "C:\\Users\\Ryan\\Desktop\\MainExcel.xlsx";
    Microsoft.Office.Interop.Excel.Application xlobj = new Microsoft.Office.Interop.Excel.Application();
    Workbook w = default(Workbook);
    Workbook w1 = default(Workbook);
    Worksheet s = default(Worksheet);
    Worksheet s1 = default(Worksheet);
    Worksheet xlsht = default(Worksheet);
    xlobj.Visible = true;
    int intItem = 1;
    DirectoryInfo dirSrc = new DirectoryInfo(@"C:\Users\Ryan\Desktop\Test_Folder\");
    foreach (FileInfo ChildFile in dirSrc.GetFiles())
    try
    // Renaming the excel sheet
    w = xlobj.Workbooks._Open(ChildFile.FullName,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    w1 = xlobj.Workbooks._Open(filePath,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    //this doesn't make any sense
    //w1 = xlobj.Workbooks.Open(filePath);
    //if (intItem > 3)
    Excel.Worksheet lastSht =
    (Excel.Worksheet)w1.Worksheets[w1.Worksheets.Count];
    xlsht = (Excel.Worksheet)w1.Worksheets.Add(Type.Missing,
    lastSht,
    Type.Missing, Type.Missing);
    s = (Excel.Worksheet)w.Worksheets[1];
    s1 = (Excel.Worksheet)w1.Worksheets[intItem];
    s1.Name = ChildFile.Name;
    // it will copy and paste sheet from one to another with formula
    s.UsedRange.Copy(Type.Missing);
    Excel.Range r = s1.get_Range("A1", Type.Missing);
    r.PasteSpecial(Excel.XlPasteType.xlPasteValues,
    Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone,
    Type.Missing, Type.Missing);
    s1.UsedRange.Formula = s.UsedRange.Formula;
    // Renaming the excel sheet
    //w.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    catch (Exception ex)
    //w.Save();
    w1.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    intItem = intItem + 1;
    //Dts.TaskResult = ScriptResults.Success
    Do you need help getting everything into a CSV, or can you take it from here???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Report script - using substitution variable with multiple values

    Hi All,
    Substitution variable with multiple values is not working correctly with Report scripts. Can you please let me know what is the syntax to assign multiple values to a sub variable using maxl:
    alter database samp.samp set variable 'ExtractQuarter' 'Q1,Q2,Q3,Q4';
    alter database Samp.Samp set variable 'ExtractQuarter' 'Q1:Q4';
    I tried both of the above but they are errored out with the below error:
    Error: 1001005 - Unknown Member [Q1:Q4] in Report.
    my requirement is different for both Actual and forecast data extract so i would like to make use of this variable to extract whole year data for Forecast and current quarter data for Actual with out duplicating the report scripts for both processes.
    Thanks,
    PRaveen

    Hi,
    Please refer following thread,
    range of months in report script?
    Hope it helps.
    Regards

  • Create ecatt script for one sales order creation with multiple line items

    Hi ,
    I want to create a ecatt script for one sales order creation with multiple line items. Preferably SAP GUI.
    This selection of data will be from an external file/ variants which will have only one row of data in it.
    Firstly: I have to sort the external file having same PO Numbers in an order.Group them together.
    Second: I have to create sales order for those many line items having same PO Number.
    Best Regard
    Taranum

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

Maybe you are looking for

  • Can I move games from one iPod to a new iPod?

    Can I transfer games in progress from ipod3 to new ipod4?

  • Can't eject

    I have my Ipod setup for manual sync and when i try to eject it itunes says it can't eject the ipod becuase it containes files that are inuse by another application. What am i doing wrong and how do i fix it please help. Dell XPS 410   Windows XP  

  • Querying from 3 tables

    i want to display the records for this day. the thing is that the data comes from 3 different tables. the query contains the ff columns: date         tableA entryid      tableA audittype   tableA name        tableB shift          tableA package    ta

  • How to draw a globe with lines of lattitude and longitude?

    I'm using CS4 on a Mac. Can anyone tell me how to draw a globe with a grid? I need 7 lines of latitude and 40 lines of longitude (i.e. separated by 9 degrees). I would like to have each segment of the grid defined as shape so I can fill each one with

  • Fermer les apps sur iPhone sous iOS 7

    Bonjour. Je viens de télécharger le nouvel iOS 7 sur mon iPhone et ne sais plus comment fermer les applications qd j'en ai fini, est-ce que quelqu' un sait faire. Merci.