Context Operators

Hi,
What are context operators and where should we use?  
Thanks in Advance

Hi,
Check attached links.
http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/
http://bobi.blog.com/2014/03/10/in-foreach-forall-context-operator-in-bo/
Amit

Similar Messages

  • Using Breaks/Context operators in WebI

    Hi guys,                        
    Had an urgent question that i needed help with.
    Right now in WebI i have a table with a column giving end times
    for Example:
    End Time
    5:02 AM
    5:44 AM
    6:05 AM
    6:15 AM
    6:45 AM
    7:10 AM
    7:22 AM
    Instead of detailed times i need to replace this column with a counter for every hour... Basically
    Hour               Count
    5th Hour           2
    6th Hour           3
    7th Hour           2
    How do i acheive this? Using breaks doesnt work right and the Context operator "In" isnt giving the right results. Do i need a variable?

    Need some more help :/
    Right now I am using
    =Left(FormatDate([SAHH Start Time];"hhMMSS");2)
    to get a column that says:
    Hour
    01
    02
    03
    04
    05
    I wanted to display it as 1:00, 2:00, 3:00 .... Also add the AM/PM to it if possible. Any idea how this can be done?

  • Contextoperators in bo 4.0(calculation context using sum)

    All,
    I am using Webi 4.0 version.I have a scenario in my webi report wherei need to sum up revenue.i want to sum up the sales  revenue generated by each employee for a store irrespective of the month.
    What i mean is even if the months are different i want to sum the revenuebased  on the branch and employee in column G.
    My webi report looks pretty much like the below sample.I dont want to apply any breaks or sections,Can i achieve this using context operators or calculation context.
    i have tried personally applying context opearators on totalevenue column by applying sum but its not summing up as in column g.
    for ex: sum(revenue for each(branchcode))
    i want to achieve the totals as shown in column totalrevenue(last column) without applying break or section.
    Can any one helpme out.
    *Branch>>>>Employee>>Store>>>>Region>>>>>>>Month>>>>>>Revenue>>>>>>TotalRevenue
    *A>>>>>>>Dave>>>>>>>D>>>>>>>North>>>>>>>Jan-09>>>>>>>100$>>>>>>>>>     
    A>>>>>>>Dave>>>>>>>E>>>>>>>south>>>>>>>Jan-10>>>>>>>200$>>>>>>>>>>300$
    B>>>>>>>Andrew>>>>>F>>>>>>>east>>>>>>>Feb-09>>>>>>>10000$>>>>>>>>     
    B>>>>>>>Andrew>>>>>G>>>>>>>west>>>>>>>Feb-10>>>>>>>100000$>>>>>>>110000$
    Regards,
    Reji.
    Edited by: reji2011 on Dec 13, 2011 5:23 PM

    Hi Reji,
    Yes, there is a reset function for RunningSum() which is something like:
    RunningSum([My Measure];([My Dimension]))
    and I think the reset dimension has to be in parentheses. You don't have to use the reset part, but it is there if you need to.
    Thanks

  • How to create the bands

    Hi,
    Can any one help me out in creating the bands in Webi (for example : Report of aging and its performance, so some measures need to be analysed against the age bands like 10-20,20-30,30-40....so on).
    Is it possible to define certain bands in the BO XI 3.1 Webi.
    Regards,
    Siva

    You can define bands in Web-I with the help of If Else logic and Context operators (If required). Here is one of the formula
    that I am using in my reports:
    =If(([Measure] ForEach ([Dim]))>=80) Then ">80%" ElseIf(([Measure] ForEach ([Dim]) Between(70;80))) Then "70% - 80%" ElseIf
    (([Measure] ForEach ([Dim]) Between(60;70))) Then "60% - 70%" ElseIf(([Measure] ForEach ([Dim]) Between(50;60)))
    Then "50% - 60%" Else "<50%"
    You can remove the For Each ([Dim]) from the formula if you want to work with default context. Else use "In", "For Each" and
    "For All" depending on the requirement.
    Regards,
    Rohit
    Edited by: rohit12 on Jun 15, 2010 8:10 AM

  • Help on SQL expressions in IDT

    Hello experts,
    I have relational connection type universe connected to SAP BW multiprovider.
    I have 2 questions...
    1. I want to be able to derive the cumulative total by fiscal year period. In WebI, the function is runningsum. What expression can I use in IDT business layer to calculate runningsum.
    Example..
    2. In WebI, there is a function sum[amount] ForAll ([Fiscal Yr Period]). How can I acheive the same function in IDT's business layer SQL expression?
    Example..desired result is below highlighted in yellow colum
    Appreciate any help or guidance.
    Just to clarify, I need to keep the calculations in the universe and not in WebI report.
    Thanks
    Ann

    Ann,
    To be perfectly honest, I would advise against it unless you have a really specific requirement which you cannot do in Webi. Cumulatives like running sum are better achieved in Webi because it offers more flexibility. You build a universe to provide the flexibility of adhoc analysis - try and visualise in SQL terms what you want to do and then consider that this can be mixed and matched with other dimensions and it throws the granularity.
    What benefits do you perceive from doing it at the IDT level? Is it simply because the end users are struggling with the context operators?

  • ODI Groovy Script to create an interface

    Hi,
    I'm working on ODI 11.1.16 and trying to create an interface using Groovy Scripts. It throws me an error "java.lang.IllegalArgumentException: DataStore shouldn't be null "
    Below are my assumptions
    Source datastore : Groovy_Source
    Target datastore : Groovy_Trgt
    Context : Global
    Stndrd conn: localhost,1521,orcl
    def file = new File('c:/interfaces.txt')
    def s = 0
    Interfaces.txt contains : TEST1,SOURCE,DUMMY_GROOVY_SOURCE,STAGING,DUMMY_GROOVY_TRGT
    DataSet dataSet = odiInterface.getDataSets().get(0);
    OdiDataStore odiDatastore1 = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName(DUMMY_GROOVY_SOURCE,Oracle);
    OdiDataStore targetDatastore = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName(DUMMY_GROOVY_TRGT,Oracle);
    It throws an error here any help is appreciated
    Thanks
    VIB

    Hi Michael,
    Below is my entire code.. Picked it up from one of the blogs just trying to fine tune it. Thanks for your reply.
    //Created by ODI Studio
    // Context operators:
    import oracle.odi.domain.topology.OdiContext
    import oracle.odi.domain.topology.finder.IOdiContextFinder
    // Folder operators:
    import oracle.odi.domain.project.OdiFolder
    import oracle.odi.domain.project.finder.IOdiFolderFinder
    // Interface operators:
    import oracle.odi.domain.project.OdiInterface
    // Interface helpers:
    import oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions
    import oracle.odi.interfaces.interactive.support.targetkeychoosers.TargetKeyChooserPrimaryKey
    import oracle.odi.interfaces.interactive.support.mapping.automap.AutoMappingComputerLazy
    import oracle.odi.interfaces.interactive.support.mapping.matchpolicy.MappingMatchPolicyLazy
    import oracle.odi.interfaces.interactive.support.actions.InterfaceActionSetTargetDataStore
    import oracle.odi.interfaces.interactive.support.aliascomputers.AliasComputerDoubleChecker
    import oracle.odi.interfaces.interactive.support.clauseimporters.ClauseImporterLazy
    import oracle.odi.interfaces.interactive.support.actions.InterfaceActionAddSourceDataStore
    import oracle.odi.interfaces.interactive.support.actions.InterfaceActionOnTargetDataStoreComputeAutoMapping;
    // Transaction operators:
    import oracle.odi.core.persistence.transaction.support.DefaultTransactionDefinition;
    import oracle.odi.core.persistence.transaction.ITransactionDefinition;
    import oracle.odi.core.persistence.transaction.ITransactionManager;
    import oracle.odi.core.persistence.transaction.ITransactionStatus;
    // Data set:
    import oracle.odi.domain.project.interfaces.DataSet;
    // Data store:
    import oracle.odi.domain.model.OdiDataStore;
    import oracle.odi.domain.model.finder.IOdiDataStoreFinder;
    // Define VARS:
    def project = new String("Test") // What is the target project?
    def folder = new String("Test Subfolder") // Which folder in target project?
    def file = new File('c:/interfaces.txt')
    def s = 0
    // Get default context:
    OdiContext context = ((IOdiContextFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiContext.class)).findDefaultContext();
    // Get Folder:
    Collection odiFolders = ((IOdiFolderFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiFolder.class)).findByName(folder);
    if (odiFolders.size() == 0)
    println("Error: cannot find folder "+folder+" in project "+project)
    OdiFolder odiFolder = (OdiFolder) (odiFolders.toArray()[0]);
    // Print default settings:
    println ("Context used = " + context.getName())
    println ("Folder for interface = " + odiFolder.getName())
    file.eachLine { line ->
    s++
    toks = line.split(",")
    if (toks.length != 5)
    println("Error in input, line: "+s)
    else
    iname = toks[0]
    Oracle = toks[1]
    DUMMY_GROOVT_SOURCE = toks[2]
    Oracle = toks[3]
    DUMMY_GROOVY_TRGT = toks[4]
    // Transactie:
    ITransactionDefinition txnDef = new DefaultTransactionDefinition()
    ITransactionManager tm = odiInstance.getTransactionManager()
    ITransactionStatus txnStatus = tm.getTransaction(txnDef)
    OdiInterface odiInterface = new OdiInterface(odiFolder, iname, context);
    InteractiveInterfaceHelperWithActions interactiveHelper = new InteractiveInterfaceHelperWithActions(odiInterface, odiInstance, odiInstance.getTransactionalEntityManager());
    DataSet dataSet = odiInterface.getDataSets().get(0);
    OdiDataStore odiDatastore1 = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName("DUMMY_GROOVY_SOURCE", Oracle);
    OdiDataStore targetDatastore = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName("DUMMY_GROOVY_TRGT", Oracle);
    interactiveHelper.performAction(new InterfaceActionAddSourceDataStore(odiDatastore1, dataSet, new AliasComputerDoubleChecker(), new ClauseImporterLazy(), new AutoMappingComputerLazy()));
    interactiveHelper.performAction(new InterfaceActionSetTargetDataStore(targetDatastore, new MappingMatchPolicyLazy(), new AutoMappingComputerLazy(), new AutoMappingComputerLazy(), new TargetKeyChooserPrimaryKey()));
    interactiveHelper.performAction(new InterfaceActionOnTargetDataStoreComputeAutoMapping())
    interactiveHelper.computeSourceSets()
    interactiveHelper.preparePersist()
    tm.commit(txnStatus)
    Edited by: VIB on Feb 18, 2013 10:46 AM

  • Formula in different Blocks

    Hi, I have 2 blocks, but the result in one of the blocks I need it in the other one.
    Is there a way to connect them without losing the result of one of the blocks in the other one?
    Example.
    I have a count formula in block A and I want in one cell of block B this count formula.The 2 blocks are in same section.
    Thanks in advance.
    Reynaldo

    Hi Reynaldo,
    You can-not use the result/summary of 1 block into another block. As, measures default context in the current block/section etc. i.e. it will display the values according to dimesion used with it.
    You have to create a variable which will give the same result as of block 1 with the help of where clause and context operators (In, For All)
    Regards,
    Rohit

  • Move "SUM" from bottom to top of section.

    I have a Webi document set up that returns distinct sets of results.
    The results have a break by Region name. There are between 2 and 50 regions that each display a distinct set of data with a blank row in between for separation.
    The problem are the sums. I'd like to have the Region name and summary formulas display on top of each Region instead of the bottom.
    I.E.
    Let's assume this is my report with two distinct regional sets of data
    REGION | EMPLOYEE | DAYS WORKED I WIDGETS BUILT I WIDGETS TO COMPLETE I REVENUE
        A           EMP 1               10                         10                                 0                            $100
        A           EMP 1               10                         10                                 0                            $100
    REGION | EMPLOYEE | DAYS WORKED I WIDGETS BUILT I WIDGETS TO COMPLETE I REVENUE
        B            EMP 1               10                         10                                 0                            $100
        B            EMP 1               10                         10                                 0                            $100
    Currently, if I were to sum the regions I'd get something like this:
    REGION | EMPLOYEE | DAYS WORKED I WIDGETS BUILT I WIDGETS TO COMPLETE I REVENUE
        A           EMP 1               10                         10                                 0                            $100
        A           EMP 1               10                         10                                 0                            $100
        A                                   20                         20                                 0                            $200
    REGION | EMPLOYEE | DAYS WORKED I WIDGETS BUILT I WIDGETS TO COMPLETE I REVENUE
        B            EMP 1               10                         10                                 0                            $100
        B            EMP 1               20                         20                                 0                            $200
        B                                   30                         30                                 0                            $300
    I know how to create the sum formulas elsewhere but how can I move that SUM row above the column headings while only having it repeat after my primary break?

    Hi ,
    This can be done by using some simple tricks:
    can I move that SUM row above the column headings
    You can do this by adding one more block (having single row with no headers) just above the main block and applying section on the region. Now you have to adjust the relative position of the two blocks so that it adjusts in the same column.
    If you want to display it below the column heading then add one more header row below the column heading. change its background color to white and place the key figures in the respective header cells. Here if you have not applied section then you may need to add the context operators(ISum(..) in (Break or region)) in the formulae to get the desired result.
    Regards,
    Rohit

  • OracleText problematic CONTEXT index

    Hello,
    Please take a look at the definition bellow:
    CREATE INDEX SCHEMA.prs_names_ldx ON SCHEMA.PERSON(NAMES_XML) INDEXTYPE IS CTXSYS.CONTEXT
    parameters ('LEXER cust_lexer SYNC (ON COMMIT) filter ctxsys.null_filter section group ctxsys.auto_section_group') ONLINE;
    ctxsys.ctx_ddl.create_preference ('cust_lexer','BASIC_LEXER');
    ctxsys.ctx_ddl.set_attribute ('cust_lexer','base_letter','YES'); -- removes diacritics
    ctx_ddl.set_attribute('cust_lexer', 'alternate_spelling', 'GERMAN');
    The person table has about 11.000.000 records.
    The fact is that about two months after the index was created, the search got slower and slower. I tried to SYS.DBMS_STATS.GATHER_TABLE_STATS and to rebuild the index, but neither worked. The only solution that solved the issue was to drop and recreate the index.
    And this happens every 1-2 months after the index is recreated.
    I'm planning to create a job that will recreate the index before the operators can complain (in a shorter time span). This is just a dirty workaround, I know, but for now I don't have any other ideas.
    Regarding this situation, I have two questions.
    1. Is there any nasty implication about automatizing the index recreate procedure?
    2. Do you have any suggestions about how I can further investigate the index degradation problem in time?
    Thank you.
    Kind regards,
    Adrian

    Do you optimize the index at all?
    How frequently is the table updated?
    With "sync(on commit)" your index will get more and more fragmented as each new record is sync'd.
    You need to run ctx_ddl.optimize_index on a regular basis to remove this fragmentation. If you do that, you shouldn't need to recreate the index regularly.
    A typical optimzation regime is to run it in "FULL" mode nightly, and then run "REBUILD" mode once a week, or once a month.

  • Need help... Context validation error for tag cfscript.

    Code:
        <cffunction name="computeHash" access="public" returntype="String">
          <cfargument name="password" type="string" />
          <cfargument name="salt" type="string" />
          <cfargument name="iterations" type="numeric" required="false" default="1024" />
          <cfargument name="algorithm" type="string" required="false" default="SHA512" />
          <cfscript>
            var hashed = '';
            var i = 1;
            hashed = hash( password & salt, arguments.algorithm, 'UTF-8' );
            for (i = 1; i <= iterations; i++) {
              hashed = hash( hashed & salt, arguments.algorithm, 'UTF-8' );
            return hashed;
          </cfscript>
        </cffunction>
    Error on web app:
    Context  validation error for tag cfscript.
    The start tag must have a matching  end tag. An explicit end tag can be provided by adding </cfscript>. If the  body of the tag is empty you can use the shortcut <cfscript .../>. The CFML compiler was processing:
    a cfscript tag beginning on line 11, column 12.
    a cfscript tag beginning on line 11, column 12.
    The  error occurred in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\salty.cfc: line  11
    9 :        <cfargument name="iterations" type="numeric" required="false" default="1024" />
    10 :        <cfargument name="algorithm" type="string" required="false" default="SHA512" />
    11 :        <cfscript>
    12 :           var hashed = '';
    13 :           var i = 1;
    I am completely lost on why it's fumbling with why it says there's no closing tag.  Help!!!!
    Thanks

    What's on lines 1-7 of that file?
    That code compiles fine for me on CF8 & CF9, so that's not where the error is.
    You're not trying to compile it on any earlier version of CF than CF8 are you?  The < and ++ operators are not valid prior to CF8.  CFMX7 might see the < as a stray angle bracket, and get confused.  I don't have CFMX7 running here to test the exact error that would produce, sorry.
    Adam

  • Regulare Expressions - Uses of logical operators

    I need to make use of logical operators within a regulare expression. (greater than, equal, etc.)
    It seems to me that java.util.regex.Pattern does not support that kind of expression. First of all: Is this true (If I am wrong with my assumption, how would the expression look like). Secondly: Which library does support this expression?
    Thanks in advance!

    Regular expressions deal with characters. In that context all characters are 'equal'. You better explain your question a helluva lot better than that.

  • Compare the elements data of the 2 context nodes using internal table

    Hi,
    How can i compare the elements data of the 2 context nodes using internal table?
    Regards,
    Ronita

    hi ronita,
    just get the nodes data into internal tables and just compare them......
    node1->get_static_attributes_table(importing table = ITAB_node1)
    node2->get_static_attributes_table(importing table = ITAB_node2)
    now u have the data of ur 2 context nodes in 2 different internal tables ..
    just compare them like
    if  ITAB_node1[ ] = ITAB_node2[ ].
    write: / 'itab1 is equal to itab2'..
    endif.
    and u can use as many as comparision operators between these 2 tables to compare them....
    regards....
    srini,,,,

  • CTXSYS.CONTEXT indextype invalid. ORA-29836

    Upgrading 8.1.7.2 to 9.2.0.1.0 on Linux.
    After executing both sets of scripts (s0900010.sql, s0902000.sql, u0900010.sql & u0902000.sql) as the appropriate users & recompiling all objects, the CTXSYS.CONEXT indextype remained in an invalid state.
    Attempts to compile it returned:
    alter indextype ctxsys.context compile
    ERROR at line 1:
    ORA-29836: failed to validate referenced operators
    So I went off to compile the referenced operators.
    SQL> select owner, operator_name from dba_operators where owner='CTXSYS';
    OWNER OPERATOR_NAME
    CTXSYS CATSEARCH
    CTXSYS CONTAINS
    CTXSYS MATCHES
    CTXSYS SCORE
    CTXSYS XPCONTAINS
    SQL> alter operator ctxsys.catsearch compile;
    Operator altered.
    1* alter operator ctxsys.contains compile
    SQL> /
    Operator altered.
    1* alter operator ctxsys.matches compile
    SQL> /
    Operator altered.
    1* alter operator ctxsys.score compile
    SQL> /
    Operator altered.
    SQL> alter operator ctxsys.xpcontains compile;
    Operator altered.
    But compiling ctxsys.context continues to fail with the same error.
    What am I missing?
    Thanks,
    Chris

    Hello Lawrence,
    I have put this question in ORACLE TEXT also. But waiting for the reply since long. Therefore thought of putting the doubt in ORACLE INTERMEDIA. Have you got any idea abt this problem. Many people facing this problem. But no one has got solution for the same. I have got reply abt the parameter COMPATIBLE to set to 9.2.0.2.0. But even that didn't work out. May be few scripts needs to run. But I have no clues abt the same. Lots of efforts and research is done on test database. But didn't work out.
    Plz help in this issue.
    Thanx,
    Kamlesh C

  • The extended syntax operators

    Hello Gurus,
           for input and output caculation context, the extended syntax operators " in"/"foreach"/"forall",  what is the difference for them, please ddemonstrate by exmple.
    Many thank.

    Hi Bo,
    I agree that sometimes this is not very clear.
    "ForEach" is meant to force a context on the measure - in other words make it do the calculation based on a specific dimension that may not be on the report.
    "In" does what "ForEach" does but allows you to do it on multiple dimensions.
    "ForAll" does kind of the opposite. It makes the measure ignore the context and give you what is basically the total for all of the dimensions in the report.
    You have to be careful, because there are default contexts in Webi blocks, sections and breaks, so this can be confusing.
    That is my understanding. But If anyone has a better explanation please help out!
    Does that make sense?
    Thanks

  • Context Propagation - Bug Weblogic 81 SP1

    Im trying to create a new InitialContext based on a principal and credential(non-admin)
    and locate some resources from the initial context.
    My issue is after the initial context is retrieved, weblogic should be using the
    standard account(the principal that it was using before obtaining the initial
    context) to do the rest of the work. I am observing that this is NOT the case
    and it continues to use the principal i specified to do the rest of the operations.
    For e.g. i get a
    Access not Allowed for subject:principals=[operator, Operators], on ResourceType:
    DomainLogHandlerRuntime Action: execute Target: registerToMe.
    which i suppose should have been called using an admin account.
    This is explicitly visible in my case where my class is a startup class and weblogic
    doesnt complete its initializing until the startup classes are loaded. Please
    let me know if this is a bug.
    Thanks
    Raj

    Im trying to create a new InitialContext based on a principal and credential(non-admin)
    and locate some resources from the initial context.
    My issue is after the initial context is retrieved, weblogic should be using the
    standard account(the principal that it was using before obtaining the initial
    context) to do the rest of the work. I am observing that this is NOT the case
    and it continues to use the principal i specified to do the rest of the operations.
    For e.g. i get a
    Access not Allowed for subject:principals=[operator, Operators], on ResourceType:
    DomainLogHandlerRuntime Action: execute Target: registerToMe.
    which i suppose should have been called using an admin account.
    This is explicitly visible in my case where my class is a startup class and weblogic
    doesnt complete its initializing until the startup classes are loaded. Please
    let me know if this is a bug.
    Thanks
    Raj

Maybe you are looking for

  • A simple Java question...

    How to wrap the text on the Button in Java? For example, the text on the button is too long, I would like to switch it into two lines, but I don't know how to do it. Can anyone tell me how to do it? Thank you very much!!!

  • Web service timeout

    When i communicate with external system using web service call, i can transafer 3500 record. if i run it for more than 3500 records it gives error "SOAP:1,023 SRT: Processing error in Internet Communication". i tried to use SM59, HTTP connection to e

  • Flash mx 2004 como justificar texto dinámico?

    Hola necesito justificar texto dinámico con flash mx no he podido dar con la solución alguien sabe como hacerlo?

  • How to delete GE Capital web site which is on top of Fox App. in Ipad2

    This morning I opened Fox News App and the GE Capital web site was on top of it, using up 75% of screen.  Can't get rid of it, don't know how.  Thought it would go away but it's still there.  Anyhow else having this problem?

  • Link in mail is not working anymore

    When there is a link in a email in the mail program it isn't working directly. Only when dragging the link to f.e. Safari it will open. What can be the solution for this problem. I already installed osx again but this doesn't work.