MDX Formula (Level.Ordinal) Problem

I'm converting some calculations to MDX to use in ASO however I am having trouble converting the condition: @curlev(Flight)<=2)
I thought I would be able to do '[Flight].CurrentMember.Level.Ordinal <= 2' but i get the error:
Error(1260052) - Syntax error in input MDX query on line 6 at token 'Ordinal' LoadFactor
Has anyone got any suggestions?
Thanks in advance :)

hmm really. I'll give that a go at work on Monday. Every example I could find seemed to indicate the way I was using it :/
thanks garycris
edit: Thanks. That was it.
Message was edited by:
Williss

Similar Messages

  • 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".

  • Inconsistent results with MDX formula

    Hi. I'm converting a BSO cube to ASO, and it has dynamically calculated formulas that I'm converting to MDX. I have a formula that is supposed to accumulate an account (Order Intake) through the months and years until it gets to the current month of the current year (set by substitution variables) and then just carries that balance forward until the end.
    This is the formula I wrote in MDX.
    IIF( Count( Intersect( {MemberRange([Years].[FY95], [&Auto_CurYr].Lag(1))}, {Years.CurrentMember} ) ) = 1,
    IIF(CurrentMember ([Period]) = [Jan],
    [Order Intake] + ([Contract Value],[Adj],[Years].CurrentMember.PrevMember),     
    [Order Intake] + ([Contract Value],[Period].CurrentMember.PrevMember)
    IIF( CurrentMember ([Years]) = [&Auto_CurYr],
    IIF( CurrentMember ([Period]) = [Jan],
    [Order Intake] + ([Contract Value],[Adj],[Years].CurrentMember.PrevMember),
    IIF( Count( Intersect( {MemberRange([Period].[Feb], [&Auto_CurMoNext_01].Lag(1))}, {Period.CurrentMember} ) ) = 1,
    [Order Intake] + ([Contract Value],[Period].CurrentMember.PrevMember),
    ([Contract Value],[Period].CurrentMember.PrevMember)
    ([Contract Value],[Adj],[Years].CurrentMember.PrevMember) /*This is the statement that evaluates for months and years after the current month and year*/
    The inconsistent results are as follows:
    I have a spreadsheet that has the years and months across the top in columns. The substitution variables are set to FY09 for the year and Oct for the month. The formula works fine until it gets to Jan of FY10, at which point it produces a number out of thin air, and carries that incorrect number through to the end.
    When I put the years and months into my rows, however, and then drill down on the months, I get different results. Not only different, but different results at different times, too. When I first drilled, all results were correct. Now when I drill, it produces a random number in October of FY09 (not entirely random, but actually double what it's supposed to be), then #missing in Nov of FY09, then the correct number thereafter. Same exact data intersection on both spreadsheets, different results. I've retrieved over and over again, and the only time it might change is if I re-drill. I've used both Essbase Add-in and Smart View with consistently inconsistent results.
    Has anyone ever encountered this sort of behavior with an MDX formula?

    Well, I finally got a formula that works. I did end up using a combination of CASE and IIF, but I never did figure out how to deal with summing up ranges of data correctly, accounting for changing substitution variables, so I had to do a lot of hard coding by month. For instance, I couldn't ask it to sum([Order Intake],[Jan],[&Auto_CurYr]:([Order Intake],[&Auto_CurMo],[&Auto_CurYr]). Although it validated fine, when I tried to retrieve it said members were not of the same generation, presumably because my substitution variable could potentially be a non - level 0 month (it worked if I hard coded the end month). Also, I really don't like the MDX version of @LSIBLINGS and @RSIBLINGS.
    But this works.
    CASE
    When Count( Intersect( {MemberRange([Years].[FY95], [&Auto_CurYr].Lag(1))}, {Years.CurrentMember} ) ) = 1
    THEN IIF(CurrentMember ([Period]) = [Jan],
    [Order Intake] + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Feb],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Feb]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Mar],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Mar]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Apr],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Apr]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [May],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[May]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Jun],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Jun]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Jul],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Jul]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Aug],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Aug]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Sep],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Sep]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Oct],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Oct]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Nov],
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Nov]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Dec]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember))
    When CurrentMember ([Years]) IS [&Auto_CurYr]
    THEN IIF(CurrentMember ([Period]) = [Jan],
    [Order Intake] + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Feb] AND CONTAINS([Feb], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Feb]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Mar] AND CONTAINS([Mar], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Mar]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Apr] AND CONTAINS([Apr], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Apr]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [May] AND CONTAINS([May], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[May]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Jun] AND CONTAINS([Jun], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Jun]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Jul] AND CONTAINS([Jul], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Jul]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Aug] AND CONTAINS([Aug], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Aug]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Sep] AND CONTAINS([Sep], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Sep]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Oct] AND CONTAINS([Oct], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Oct]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    IIF(CurrentMember ([Period]) = [Nov] AND CONTAINS([Nov], {MEMBERRANGE([&Auto_CurMoNext_01].FirstSibling, [&Auto_CurMoNext_01].Lag(1))}),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[Nov]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember)),
    Sum(CrossJoin({[Order Intake]}, {[Jan]:[&Auto_CurMo]})) + sum(([Order Intake],[YearTotal],[FY95]):([Order Intake],[YearTotal],[Years].CurrentMember.PrevMember))
    WHEN CONTAINS([Years].CurrentMember, {MemberRange([&Auto_CurYr].Lead(1), [Years].[FY15])})
    THEN ([Contract Value],[Adj],[Years].&Auto_CurYr)
    END
    Thanks for looking at it, Gary, I appreciate it.
    Sabrina
    Edited by: SabrinaD on Nov 18, 2009 2:29 PM
    Edited by: SabrinaD on Nov 18, 2009 2:31 PM
    Edited by: SabrinaD on Nov 18, 2009 2:34 PM
    Edited by: SabrinaD on Nov 18, 2009 2:35 PM

  • VARIABLE IN MDX FORMULA

    Hello,
    I have a package which only rund a logic,
    this package enables to select an entity on which the logic will run
    so in my package assign parameters component , i have my prompt
    PROMPT(SELECTINPUT,%MY_ENTITY%,"Enter the entity",,"%ENTITY_DIM%")
    and then
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION MYENTIY=%MY_ENTITY%")
    TASK(EXECUTE FORMULAS,LOGICFILE,TEST.LGF)
    in my logic, i want to use the entity put in the package in a mdx formula,
    *MEMBERSET(%Ent_R%,"DESCENDANTS(FILTER([ENTITE].MEMBERS,[ENTITE].CURRENTMEMBER.PROPERTIES("ENTITE_REF")=MYENTITY),99,LEAVES)")
    the variable MYENTITY isn't working, so my variable %Ent_R% is corrupted too
    how can i change the syntax in order to include MYENTITY parameter please
    i have tried so many things, i'm stuck
    thanks in advance
    regards
    CL

    Hello,
    First of all, most sincere thanks for replying, i'm stuck and blocked and beginner in logic and have no collegue around me to advice me or help me, and i've tried so many things that i end up mixing them
    the problem is that the follwing syntax
    *MEMBERSET(%Ent_R%,"DESCENDANTS(FILTER([ENTITE].MEMBERS,[ENTITE].CURRENTMEMBER.PROPERTIES("ENTITE_REF")=%ENTITY_SET%),99,LEAVES)")
    isn't validated when i do a "validate and process logic" it rejects me by giving this message
    error in step 1 of QueryCubeAndDebug:-2147217900 Formula error - syntax error - token is not valid: "{DESCENDANTS(FILTER([ENTITE].MEMBERS,[ENTITE].CURRENTMEMBER.PROPERTIES("ENTITE_REF")=^%^ENTITY_SET%),99,LEAVES)}"
    when i put the variable name around commas like ' ' or " "
    this way  for instance
    *MEMBERSET(%Ent_R%,"DESCENDANTS(FILTER([ENTITE].MEMBERS,[ENTITE].CURRENTMEMBER.PROPERTIES("ENTITE_REF")="%ENTITY_SET%"),99,LEAVES)")
    the logic validates, the package runs but no data are written
    in the debuglogicfile, it seems that it doens't recongnize the fact that it is a variable, and put it as string
    i really don't know how to put it

  • Need some help with MDX formula

    Hello, I am not finding any good documentation on MDX formulas, there is a specific one that I need some help with....could someone please elaborate what exactly does this formula mean? thanks.
    (MEASURES.[SIGNEDDATA],
    CLOSINGPERIOD([%TIMEDIM%].
    [%TIMEBASELEVEL%]))

    If new MEASURE gets added to Measure's table , in BPC Client , etools->client Options-> Refresh Dimensions should get the new measure into the CurrentView .IF not try  etools->client Options-> Clear Local application information .
    Formula 2 : 
    (MEASURES.SIGNEDDATA,
    CLOSINGPERIOD(%TIMEDIM%.
    %TIMEBASELEVEL%))
    This formula is used to retrieve AST & LEQ account values.
    If current time member is at monthlevel ,ie  ClosingPeriod of  2011.FEB is  the current member it self ,and would retrieve 2011.FEB value.
    If Current time member is at quarter level then ClosingPeriod of 2011.Q1 is 2011.Mar  ,and would retrieve 2011.MAR value.
    If Current time member is at year level then ClosingPeriod of 2011.TOTAL is 2011.DEC  ,and would retrieve 2011.DEC value.
    Formula 1 :
    MEASURES.SIGNEDDATA
    Irrespective of the level of the Time , MEASURES.SIGNEDDATA would retrieve current Time member value.This formula is used to retrieve INC & EXP account values
    if current time member is at month level,2011.FEB , 2011.FEB value is retrieved.
    if current time member is at quarter level,2011.Q1 , 2011.Q1(JANFEBMAR)  value is retrieved.
    if current time  member is at year level,2011.TOTAL , 2011.TOTAL(JAN,FEB,....,DEC)  value is retrieved.
    Hope this helps.

  • Dimension Default member use a otherdimension.currentmember.level.ordinal = 3

    Hi
    I am trying to create a condition in a dimension defaultMember attribute where I use another dimension as a condition.
    It's possible to call another dimension or a measure to the dimension defaultMember expression ?
    I am getting the error: Error Loading Metadata: DefaultMember(Dim Item, Item) The dimension [DimStore] wasnot found in the cube when the string [Dim Store].[H - Store by Region] was parsed.
    The mdx used:
     case when [Dim Store].[H - Store by Region].currentmember.level.ordinal  = 3 
    then [Dim Item].[tem].&[3] 
    else   [Dim Item].[Item].[All] end
    Thanks

    Hi MJGomes,
    According to your description, you call another dimension when defining a default member of a dimension. Right?
    In Analysis Services, the default member of an attribute is used for queries where members from this attributes is not specified. It can't refer to another dimension in condition or using other dimension member because the member should be a static member
    within the current dimension. Otherwise it can be confused when executing the MDX query.
    Reference:
    Define a Default Member
    Setting default member in role playing dimensions
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • Need help with MDX formula to sum months

    I was able to use Gary C's suggestion to sum daily data for 90 days with the following formula.
    SUM( TAIL( TUPLERANGE(
    ([FY_2006], [01/01]), ([Scenario].CurrentMember,
    [Time].CurrentMember) ), 90 ))
    This formula works great - even when crossing different years in the Scenario dimension.
    I'm now trying to sum the prior 3 months using a similar TupleRange command:
    SUM( TAIL( TUPLERANGE(
    ([FY_2006], [JAN]), ([Scenario].CurrentMember,
    [Time].CurrentMember) ), 3 ))
    I'm running into an issue due to additional parents in the time dimension. January and February of the current year are pulling data from the children of another parent in the Time dimension as opposed to Nov and Dec from prior year.
    My Time dimension is setup as follows:
    Time
    |
    |-Total Year
    | |-Jan
    | | |-01/01
    | | |-01/02...
    | |.
    | |-Feb... Dec (each month has days as children)
    |.
    |.
    |-QTDs
    | |- Various parents and shared children
    |.
    |-Weeks
    | |-FY08_Weeks
    | |.
    | |-FY09_Weeks
    Using the previous TupleRange command, when I retrieve data for Jan it retrieves data from the following members:
    Jan
    FY08_Weeks
    FY09_Weeks
    Any suggestions on how I can write the MDX formula so my 3 Month formula pulls in the correct members? (That is, it should only pull in members from the 'Total Year' parent.)

    In ASO architecture, if you want to aggregate these multiplied values you probably want to do the multiplication prior to loading so the sum of the products rolls up. Right now, you can't have the multiplication done in MDX and then have ASO aggregate. It's mostly a performance concern; you can do the multiplication and aggregation in one formula if you want.<BR><BR>The basic multiplication is just<BR> [Standard Material Per Unit] * [Units Sold]<BR><BR>To aggregate, you need to wrap in additional clauses. I've attached code here so you can see it with indenting- I believe that consistent indenting helps catch a lot of syntax errors.<BR><BR>You will also need to assign the formula to a new member (account or otherwise).<BR><BR>If you only want to see the values at level-0 and you don't want them aggregated, it's very easy:<BR><BR>iif (<BR> [Product].CurrentMember.[LEVEL_NUM] = 0,<BR> [Standard Material Per Unit] * [Units Sold],<BR> MISSING<BR>)<BR><BR><BR>

  • LGF VS MDX FORMULAS

    Hi gurus;
    What is the difference between MDX and Script Logic formulas?
    For example
    Can i write below formulas in LGF ?
    function MOVEMENT(%ACCOUNT%)
    iif(COUNT(%Time_Dim%.Children) =0,
    %ACCOUNT%-(%ACCOUNT%,%Time_Dim%.PrevMember),
    SUM(Descendants(%Time_Dim%.CurrentMember,99,LEAVES)))
    *endFunction
    If yes, Whats the meaning of 99? and Children
    The another question is IIF MDX Formulas
    Iif([Time].CurrentMember.Children.Count=0, [Account].[AccRec] - ([Account].[AccRec], [Time].PrevMember), SUM(Descendants([Time].CurrentMember, [Time].[Month], LEAVES)))
    I want to forward datas to month 8 but if month 8 is not empty , do nothing.
    My account dimension name which want to forward is : SALES_K
    account dimension member which want to forward is : K1005
    My Time dimension name : TIME current month:8 id name: 2010008
    Time period id : 2010001 , 2010002 , 2010003 ...
    Many thanx for your replies
    Have a nice day

    Hi Breathe
    You can write/use this formula.
    In your AccountRec Account calculation.,the formula indicates the sum of all receivables of all months  as per the Time Dimension, by arriving the diference of prevous month and current month.
    It starts with the identifying the data as per your Time dimesnion (from Period Id-Parent and Children), and it sum up the data of all the months i.e, all Children( ex: Time period id : 2010001 , 2010002 , 2010003 ... 2010008)
    The data will not be available at Parent level, Hence the iteration of Children calculation count will be 0 and it starts from next child in the list.
    In this statement, the count 99 indicates the number of all iterates to run the calculation formula till the end of the list as per the number of children( depends on number of child months you have defined under one parent year, in TIME Dimension) it has to calculate, as per your formula(SUM(Descendants(Time.CurrentMember, Time.Month, LEAVES)))
    for more information on the logic MDX formula, please refer the below SAP help:
    http://help.sap.com/saphelp_bpc75_nw/helpdata/en/f8/aac4ccf5a34fcdb40ba3e508a0ae0e/frameset.htm
    Hope this will help you a lot.
    A good question:) Breathe!!!
    Thanks & Regards
    ukraghu

  • Error in execution of mdx formula in ASO::  Recursion limit[31] reached

    Hi,
    We are implementing the ASO cube using the Hyperion Essbase version 9.3.1.
    Few dimension members need to have formulas which we are writing using the mdx.
    Mdx formulas are successfully verified but at retrieval time, it is throwing the following error-
    Error executing formula for[604120](line 0) : Recursion limit[31] reached.
    In outline, mdx formulas has been assigned to member name '604120' and '604520' in 'Report Line (P/L)' dimension as per business requirement.
    Formula on member '604520' = [604120]-[604320] +[604220]
    And
    Formula on member '604120' =
    IIF(
    IS([Time].CurrentMember, [Jan]),
    ([Report Line (P/L)].[604520], [Dec], [Year].CurrentMember.PrevMember),
    ([Report Line (P/L)].[604520],[Time].CurrentMember.PrevMember, [Year].CurrentMember)
    On further investigation, it seems there is dependencies in formulas. And it need to be rewrite.
    I am new in mdx queries. Please help me to write. Quick respone will be appreciated.
    Thanks & Regards,
    Mohit

    http://essbase.ru/ wrote:
    Check Essbase CFG
    - it's Error from settings limitisWhich setting are you referring to for ASO.
    Cheers
    John
    http://john-godowin.blogspot.com/

  • Row level security problem.

    Hy all, I'm new to Oracle and though i've google it a lot I didn't manage to find a solution to this problem:
    I'm using sql developer and Oracle 10g.
    I have this two tables :
    CREATE TABLE HR_employees
    (codHR NUMBER(3) CONSTRAINT pk_hr PRIMARY KEY,
    coddep NUMBER(4) not null,
    DB_user VARCHAR2(10),
    and
    CREATE TABLE Candid
    (codcan NUMBER(2) CONSTRAINT PK_candidat PRIMARY KEY,
    codHr NUMBER(3) NOT NULL,
    CONSTRAINT FK_CODHR FOREIGN KEY (codHR) REFERENCES HR_employees (codHR) );
    I tried to implement row level security on them by using two views:
    CREATE OR REPLACE VIEW employees_v AS
    SELECT * FROM hr_employees
    WHERE DB_user = user
    UNION
    SELECT * FROM hr_employees
    WHERE codhr=(SELECT codhr FROM hr_employees WHERE db_user=user );
    AND coddep IN (4000,5000);
    CREATE OR REPLACE VIEW candid_v AS
    SELECT cand.*
    FROM candid cand , hr_employees hr
    WHERE cand.codhr= hr.codhr
    AND hr.db_user=user
    UNION
    SELECT cand.* FROM candid cand, hr_employees hr
    WHERE hr.coddep=(SELECT H.coddep FROM hr_employees H
    WHERE H.db_user=user
    AND H.coddep IN (4000,5000) );
    What I want to do is to disconnect and connect with another user from SQL Developer and see different fields based on the user and the department, Sql developer doesn't seem to recognize the user connected to the database..everytime I receive a no row selected statement, only when I connect with SYS and put the actual username WHERE H.db_user='SYS' they seem to work. I have created the tables with SYS and granted Select on the views to the users, the users don't have privilegies on the actual tables.
    Sorry for the bad english,it's a foreign language to me ,
    I hope you can help me

    Hi,
    Damorgan is right: "Row level security has nothing to do with views" in the sense that the two are independent. You can have row-level security with or without views, and you can have views with or without row-level security. dbms_rls is a very useful and powerful way to implement row-level security, and you should check it out, but it's not necessarily the answer to all row-level security problems.
    I'm not sure I understand your problem beyond the need to restrict user A's access to two tables.
    If which rows user A is allowed to see depends on the results of queries from those same tables, including rows that user A is not allowed to see (that is, you need to do sub-queries with some other user's (let's call this user B's) privileges), then you can do those sub-queries in stored procedures.
    Stored procuderes can run with the privileges of the procedure owner, regardless of who is calling them. Using a function called user_codhr owned by user B, you could define a view like this:
    CREATE OR REPLACE VIEW employees_v AS
    SELECT * FROM hr_employees
    WHERE DB_user = user
    OR    (   codhr = user_codhr
          AND coddep IN (4000,5000)
          );If the results of the function will be the same throughout the session, you can call it once, at the beginning of your session, and save the results in a SYS_CONTEXT varaible or a global temporary table.
    If you need more help, post a more detailed example of the problem, such as "With this data in the table, B should see all rows but A should see only ...".

  • Ordinal Problem - also posted in InDesign Scripting

    I am running InDesign CS3 on XP.  I know there are other posts about ordinal problems, but none seem to lead me to a solution.
    My many fonts work with ordinal in MS Word when typing numbers like 22nd, 36th, etc.  However, the same fonts in InDesign do NOT display ordinal type.  Only a select few fonts work with ordinal in InDesign.  When I scroll to the "Open Type" submenu for most fonts, ordinal is in brackets [ordinal].  I still select it, but nothing comes of it. Even with basic fonts like Tiimes New Roman.
    Any ideas of how to fix this?  Just seems odd when the fonts work in MS Office but not Adobe.
    Thanks,
    Jarred

    It can't be done (safely -- see below) with a single GREP; 1st, 2nd, 3rd need special handling.
    In general, you can look for
    (?<=\d)th\b
    and replace with no text, just Superscript in the Change To formatting. This looks for any text "th" with a number on its left (the parenthesized expression), and a clear word break on its right (the backslash b).
    "1st" needs
    (?<=1)st\b
    "2nd" and "3rd" need
    (?<=2)nd\b (?<=3)rd\b
    If your text allows it, you can try to do all at once:
    (?<=\d)(st|nd|rd|th)\b
    -- this way you also automatically pick up wrong ordinals, such as "1nd".

  • Essbase 11.1.2.1 - Converting BSO Member Formula to ASO MDX Formula

    Hi all,
    I'm quite new at Essbase and I'm currently using Essbase 11.1.2.1. I have 2 cubes: one is a BSO cube and the other is an ASO cube.
    In the BSO cube, I have an account that has member formula:
    IF(@ISATTRIBUTE("US"))
    ("Sales"->"Budget"->"USD")-("Sales"->"Actual"->"USD");
    ELSEIF(@ISATTRIBUTE("EU"))
    ("Sales"->"Budget"->"EUR")-("Sales"->"Actual"->"EUR");
    ELSEIF(@ISATTRIBUTE("UK"))
    ("Sales"->"Budget"->"GBP")-("Sales"->"Actual"->"GBP");
    ENDIF
    Notes:
    - Sales is an account
    - US, EU, and UK are members of Country attribute dimension
    - Budget and Actual are members of Scenario dimension
    - USD, EUR, and GBP are members of Currency dimension
    I understand that the member formula for BSO and ASO are different. Can anyone please advise me on what the formula should be in ASO cube as MDX formula?
    Thank you very much!

    CASE [Currency].CurrentMember.[Country]
         WHEN "US" THEN ([Sales], [Budget], [USD]) - ([Sales], [Actual], [USD])
         WHEN "EU" THEN ([Sales], [Budget], [EUR]) - ([Sales], [Actual], [EUR])
         WHEN "UK" THEN ([Sales], [Budget], [GBP]) - ([Sales], [Actual], [GBP])
         ELSE 0
    END
    *Note that I am assuming Country is an attribute of Currency based on the information provided.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • MDX Formulas

    Are MDX formulas used only in ASO cubes or we can use it BSO as well.
    I looked into the Essbase DBAG, But could not find the right information. If anybody know about this, please clarify.
    Thanks for the Help in advance..........

    Hi ,
    One can use MDX script editor to retrive data from BSO cubes .
    But, As far as the member formulas of the ASO outline is concerned , we got to use the MDX only.
    I have tried this on the 7X version.
    Sandeep Reddy Enti
    HCC
    http://analytiks.blogspot.com

  • Help with MDX formula

    Hi All,
    I have MDX formula which is validating but not producing result, can you guide me in right direction to fix the issue.
    What i am trying to accomplish is?
         View 1 (Raw)                    View 2 (Adjusted)     
    ACT     FCST     Calc          ACT     FCST     Calc
    X     X     X          X     X     X
    0     0     0          0     X     0
    0     X     X          X     0     0
    X     0     X          0     0     0
    If ACT or FCST is '0' in RAW it has replace everything with '0' in Adjusted. else copy Actual and Forecast values to adjusted.
    "case when is ([Raw],[Actuals]) = '0' or ( [Adjusted],[ Forecast]) = '0' then '0' else ([Actuals] = [Raw],[Actuals]) and [ Forecast] = ([Raw],[Forecast])" this is my formula which is validated but i don't see any result.
    Help will be very mush appreciated.
    Thanks in Advance
    Vic..

    Hi,
    I am not sure which member you are trying to write that formula on. It should be on 'Adjusted' member as that is what you want to calculate. I am not sure how your formula got validated - You can try any of these formula or modify your formula on similar lines and it should work.
    CASE WHEN ([Raw], [Act])= 0 OR ([Raw], [Fcst]) = 0
    THEN
    0
    ELSE
    [Raw]
    END
    IIF ( ([Raw], [Act])= 0 OR ([Raw], [Fcst])= 0 , 0 , [Raw])
    Regards,
    Sunil
    Edited by: sunil k on Jan 17, 2013 2:28 PM

  • Doubt Reg How to implement MDX formula in ASO Cube

    We are using Essbase 7x for implementing ASO application, We are struck in implementing MDX formuls in Accounts dimension members. As per the requirement
    We have to calculate
    Cost Per kilo[Total shipment Cost]/[Billed Weight]
    Fuel Surcharge cost per kilo[Fuel Surcharge cost]/[Billed weight]
    Need to implement these formula's for the mentioned Accounts members. As we are new to this concept plz let me know if
    we wrote these in MDX editor and how to link these to the particulr mrmber in the dimension.please help me out in implementing these formula's

    Hi,
    1. For ASO cubes also, you can have forumulas on your cube's outline individual members.
    2. If the dimension is "accounts" you can write MDX forumulas on the members of the accounts dimension
    3. The two members 'cost per kilo' and 'fuel surcharge cost per kilo' and their respective forumulas are Total shipment Cost/Billed Weight and Fuel Surcharge cost/Billed weight.
    4. If you have the members like Total shipment Cost,Billed Weight and Fuel Surcharge cost, create 2 account members for which you need to write formulas , then go to 'formula' tab of these members and write a simple division formula.For ASO cubes, no need to end them with semi colon.
    One can use MDX editor to write down queries and extract data too, i.e queries . More of it can be found in the DBAG .
    Sandeep Reddy Enti
    HCC
    http://hyperionconsultancy.com/

Maybe you are looking for

  • Cannot open attachments with .eml extension and this not listed in Firefox Applications.

    Have been receiving attachments from trusted friends that have .eml file extensions and they won't open. The Firefox Application list doesn't include this. Any idea how to open them?

  • Apple TV Imported pictures have POOR quality!! HELP!!!

    I am downloading pictures to enhance my slideshow/screensaver and they all come out with poor resolution. I have tried various sizes and cant figure out what size pictures I need or what resolution????!!! I have not found a picture that comes up HD c

  • [ 10g ] How to make dbms_lob.erase trim fragment away?

    Hello! I'm trying to remove some parts of CLOB with DBMS_LOB.ERASE, and it obviously just replaces fragment with spaces. This behaviour is stated in manual, but the fact is I need to actually REMOVE this fragment. More to that, I also need to insert

  • Getting a error when trying to launch brtools

    Hi all, Could anyone please help getting the following error while trying to launch brtools. ukbsfspg:tnxadm 35> brtools BR0651I BRTOOLS 7.00 (32) BR0252E Function stat() failed for '/usr/sap/TNX/SYS/exe/run/brarchive' at location BrFileStatGet-1 BR0

  • Regarding MDM Import and Syndication Server

    Hi, I have earlier worked in MDM Import Server. Today, I successfully did MDM Syndication by MDM Syndicator. Now, the point is I need to do Import and Syndication by MDM Import Server and MDM Syndication Server. The MDM Version is 5.5. Now, the point