MDX query in Init Block

hi,
Need a help regarding the Initialization block which connects to a Essbase and fetches the results using a MDX query.
I need to get the Max of the month cube column and put in a variable.
The cube time hierarchy contains the column at the 5th physical level with values as 2008 August, 2008 December, 2009 January and 1994 March etc.
Now I want to get the Max of the value i.e. 2009 January.
I saw another Init block with the query. This query gave result as 1994 March.
select
{} on columns,
{ClosingPeriod([DEPMTI01].Generations(5))} on rows
from [XXX.YYY]
Now when I modified the query to below and run it throws an syntax error.
select
{} on columns,
{Max([DEPMTI01].Generations(5))} on rows
from [XXX.YYY]
Please help me out with the correct way on writing the MDX so as I can fetch my desired result of 2009 January.
Regards,
Bhavik

Hi Manas,
As u would know ParForEach i sused if u have parallel processing branches,
The max u can have is 999.
Check this link
http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/frameset.htm
Hope it helps!!!!!!!!!!!
Reward points if u found it useful

Similar Messages

  • Initialized values for Init blocks disappear at random

    Hi everyone
    I have a strange scenario and would appreciate your help with some ideas on how to troubleshoot this.
    We have OBIEE 10.1.3.4. It is a BI Apps 7.9.6.1 environment and OBIEE is integrated with EBS. Everything is working 100% fine and all initialiation blocks are initialized succesfully. Now iit has happened a couple of times that the init blocks seems to "lose" their initialized values. For example, CURRENT_FISCAL_YEAR will be initialized to 2011. Then out of the blue, next time you log in this init block has the value of 2008, which is the default initializer. The servers are all up and there are no errors.
    Any ideas about what is going on here?
    Thank you

    Check the SQL query in init block.It will take default value if SQL query does not fetch any record.
    I guess you have created a repository variable.
    Regards,
    Sandeep

  • Error In MDX query

    Statement: SELECT{ CROSSJOIN({ [Product].[Product] }, { [Measures].[Shipping Units] })} ON ROWS FROM [Shipment]
    com.interlacesystems.iquery.QueryException: COLUMNS axis specification missing
         Statement: SELECT{ CROSSJOIN({ [Product].[Product] }, { [Measures].[Shipping Units] })} ON ROWS FROM [Shipment]
         at com.interlacesystems.iquery.imdx.QueryCommand.resolve(Unknown Source)
         at com.interlacesystems.iquery.imdx.QueryCommand.resolve(Unknown Source)
         at com.interlacesystems.iquery.imdx.IMDXQueryFactory.parseStatement(Unknown Source)
         at com.interlacesystems.iquery.QueryFactory.createStatement(Unknown Source)
         at com.interlacesystems.iquery.DefaultQueryExecutionHandler.<init>(Unknown Source)
         at com.interlacesystems.isclient.admin.query.QueryAction.makePreviewURL(Unknown Source)
         at com.interlacesystems.isclient.admin.query.QueryAction.exportQuery(Unknown Source)
         at com.interlacesystems.isclient.admin.query.QueryAction.preview(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
         at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
         at com.interlacesystems.isclient.common.ISAction.process(Unknown Source)
         at com.interlacesystems.isclient.common.ISAction.execute(Unknown Source)
         at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
         at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
         at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
         at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.interlacesystems.isclient.auth.SessionInitFilter.doFilter(Unknown Source)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.interlacesystems.isclient.auth.AuthorizationFilter.doFilter(Unknown Source)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.interlacesystems.isclient.auth.AuthenticationFilter.doFilter(Unknown Source)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.hyperion.css.wls.CssJpsFilter.doFilter(CssJpsFilter.java:32)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.interlacesystems.isclient.auth.RootFilter.doFilter(Unknown Source)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    I am getting following error in While Executing a folllowing MDX Query.....

    general mdx format is
    SELECT
    { } ON COLUMNS,
    {} ON ROWS
    FROM [Cube]
    I think you are missing { } COLUMNS, in query.
    Thanks,
    Sumant

  • Has no value definition - Session INIT Block.

    Hi,
    I have a Session initialization block for Fetching Departments from a Security table for the user logging in.
    One user can have Multiple Departments assigned to him, so i enabled Row-wise initialization in INIT Block.
    But when a user not assigned to any departments logs in, i am getting 'Session variable has no value definition' error in all the reports. But i should instead pass a default value when SQL in INIT Block is not returning anything. Like '0'.
    How can i do this? please respond.
    Thanks
    Swami

    Hi Swami,
    When the query fetches a result set, the variable gets initialized.
    But, when the query doesn't fetch any rows, the variable doesn't gets initialized and hence "no value definition" errors out.
    So, to avoid this,
    In the query itself, place an exception condition which returns '0'.
    select dept_name from table
    where user_name = ':user'
    UNION
    select '0' from table
    where user_name <> ':user'or you can use like this
    select CASE WHEN user_name = ':user' THEN dept_name ELSE '0' END
    from tableP.S: Query written orally. (Pls adjust the query accordingly)
    Regards,
    Raghu

  • Is there any Update command in MDX query

    My situation is follows:<BR><BR><BR> Jan-2005 Brands Products Sales <BR>Bill:20001-ABC 100<BR>Bill:20001-XYZ 20<BR> Customers<BR><BR>Is there any way where i can delete the member "Bill:20001-XYZ" and add the value 20 into<BR>"Bill:20001-ABC" so that it becomes<BR><BR><BR> Jan-2005 Brands Products Sales <BR>Bill:20001-ABC 120<BR> Customers<BR><BR><BR>Is there any update command introduced in MDX query which would resolve the above issue?.

    In it's current incarnation, Essbase MDX can't do this, I believe it is coming in a future release, but I wouldn't expect it too soon, maybe within a year. There are others that can provide more insight if and when it will be available.<BR><BR>By the way, I'm assuming this is an Aggregate Storage Database. If it were a Block Storage database, there would be a couple of different ways to do this (Calc script, lock & send via spreadsheet)<BR><BR>

  • Row wise init block has no value defination.

    Hi Experts,
    I ahve requirement where i need to pick the department of loged in users in dashboard prompt.
    So I created the session variable with row wise and written the query:
    SELECT DISTINCT 'Department', Department_Name FROM tableA WHERE A.LOGIN_ID= ':USER'
    But I get this error in answers:
    The session variable, NQ_SESSION.Department, has no value definitions

    Thanks for your help !
    I created a session variable UNAME
    SELECT 'VALUEOF(NQ_SESSION.USER)' FROM DUAL
    Then I created the second variable with row wise init block.
    SELECT DISTINCT 'Department', Department_name FROM Department A WHERE A.LOGIN_ID= 'VALUEOF(NQ_SESSION.UNAME)'
    in second init block i.e. for department i added the init block(Uname) in execute precedence.
    Still I am getting the same issue..any help pls?
    Thanks.

  • Row-Wise GROUP init block isn't creating the variable

    Hi,
    I have an Init Block to set the GROUP variable using row-wise initialization. When I log into Answers with a user, and then check the session variables from Admin Tool, I don't see the GROUP variable anywhere. It seems like the init block is not creating it.
    I have execution precendence set up the way it should be. I have the groups created in both RPD and Presentation Services. Below is my simple query to try to get it to work:
    SELECT 'GROUP', 'OFFICER' FROM DUAL
    UNION ALL
    SELECT 'GROUP', 'SUPERVISOR' FROM DUAL
    Any ideas?
    Thanks
    Edited by: oroborus on Mar 24, 2010 1:25 PM

    Yes I saw the query in the log, it was successful. I added a simple request to a dashboard to display the value of GROUP, and it seems to be working correctly from there. Do the row-wise variables not show up in Admin tool session monitor?

  • OBIEE - ESSBASE   ERROR - 1200467 - Error executing formula for [MDX query]

    I have an issue on essbase with a query with 50 member filters.
    The environment is OBIEE 11g over ESSBASE 11.1.2 with an ASO cube.
    The user for essbase are with database access filters.
    I have the following issue, OBIEE returns a query that filter 30 members and the query runs ok, but the same query with a 50 member filter returns the following error when i execute it on MAXL :
    MAXL Error
    ERROR - 1200467 - Error executing formula for [MDX query]: status code [1130203] in function [].
    ERROR - 1241101 - Unexpected Essbase error 1200467.
    i paste an example of the query that returns OBIEE
    With
    set [_Account2] as '{Distinct({[Account].[Allocated FTE - Budget]})}'
    set [_Employee0] as '[Employee].members'
    set [_Fund4] as 'Generate([Fund].Generations(2).members, Descendants([Fund].currentmember, [Fund].Generations(4), leaves))'
    set [_Position4] as '{Distinct({[Position].[POS111165], [Position].[POS111166], [Position].[POS111167], [Position].[POS111540], [Position].[POS112331], [Position].[POS113201], [Position].[POS113247], [Position].[POS113248], [Position].[POS113540], [Position].[POS113618], [Position].[POS113954], [Position].[POS114109], [Position].[POS114194], [Position].[POS115224], [Position].[POS115912], [Position].[POS115913], [Position].[POS116727], [Position].[POS117229], [Position].[POS117491], [Position].[POS117587], [Position].[POS117610], [Position].[POS117979], [Position].[POS119456], [Position].[POS121262], [Position].[POS121458], [Position].[POS121698], [Position].[POS123368], [Position].[POS124027], [Position].[POS124028], [Position].[POS124110], [Position].[POS124396], [Position].[POS125623], [Position].[POS125624], [Position].[POS126476], [Position].[POS127960], [Position].[POS129352], [Position].[POS129468], [Position].[POS129494], [Position].[POS129535], [Position].[POS129608], [Position].[POS129679], [Position].[POS129730], [Position].[POS129905], [Position].[POS130010], [Position].[POS130144], [Position].[POS133456], [Position].[POS134943], [Position].[POS135231], [Position].[POS135404], [Position].[POS135734]})}'
    set [_Program3] as 'Generate([Program].Generations(2).members, Descendants([Program].currentmember, [Program].Generations(3), leaves))'
    select
    { [Budget Item]
    } on columns,
    NON EMPTY {crossjoin({[_Account2]},crossjoin({[_Employee0]},crossjoin({[_Fund4]},crossjoin({[_Position4]},{[_Program3]}))))} properties GEN_NUMBER, [Account].[MEMBER_UNIQUE_NAME], [Account].[Memnor], [Program].[MEMBER_UNIQUE_NAME], [Program].[Memnor], [Employee].[MEMBER_UNIQUE_NAME], [Employee].[Memnor], [Fund].[MEMBER_UNIQUE_NAME], [Fund].[Memnor], [Position].[MEMBER_UNIQUE_NAME], [Position].[Memnor] on rows
    from [BCPSASO2.BCPS_ASO]
    any suggestions ?
    Thanks
    Niko
    Edited by: user8367101 on Mar 1, 2011 10:31 AM

    Here it is:
    It is a Windows Server 2003 R2
    Processor 8393 SE
    31.9 GB of RAM
    32-Bit
    How does "memscaling" works?
    I also think that are high but it is the way it was configured before I managed the application. For my DB
    Index Cache setting: 205800
    Index cache current value: 205800
    Data file cache setting: 33768
    Data file cache current: 0
    Data Cache setting: 877273
    Cata cache current: 71540
    Block Size: 65408

  • BIP Security - Data Level Security / Init Blocks

    Hello, I am using BIP 11.1.1.5. I am aware that in OBIEE data-level security can be implemented by placing permissions on a application role. However, I am wondering if this can be accomplished in BIP if I use a BI Analysis or SQL as the datasource for my data model. I have a catalog of 100 BIP reports and was wondering if I can implemented data-level security via the RPD. I am exploring the various options of executing this type of security. I already performed some research and found Oracle's whitepaper on Row Level Security with BI Publisher.
    Another Question: Does session init blocks work with BIP? I flipped the switch for BIP security model to 'Oracle BI Server' on the Admin security page. Next, I went to the RPD in online mode and created a simple query inside a init block. However, when I logged into BIP I didn't see the variable from the session init block in the Manage Sessions window.
    Thanks

    Look at the below link..It has three options. this one is from veeravalli I believe..I personally like the second option if there are not many reports to work with.
    cool-bi.com

  • Handling errors in OBIEE init block

    Hi,
    Is there a way to catch an error in the execution of an init block? Looks like the only way to figure out that the query for the initialization block has failed is by looking at NQServer.log and there is otherwise no alert or indication that some failure has occurred at all.
    I would like to be able to alert an administrator as soon as an init block query fails.
    thanks.
    Edited by: srrao on Nov 24, 2010 2:19 PM

    You can do some "insert or update" in the init block or use DB triggers to catch fails. select user_name from table(orabi_auth(:USER)) Orabi_auth inserts information about logged user in DB and returns logged user name, so I can analyse it later.

  • Init Block for Dynamic Repository Variables

    I have defined an Init Block in the RPD. I see that you can set the refresh intervals via a schedule that is a set time. I want to be able to trigger this Init Block once my ETL process has completed. Is there a way to externally trigger the Init Blocks ?

    We faced the same problem and I am sorry to say that OBIEE does not support this feature. There is no way to trigger a repository variable refresh from outside OBIEE. In the end we decided to set the refresh interval to 2 mins. This means that when new data is loaded then at most the variables will take 2 mins to refresh. We use repository variables to to store the latest business date our DWH has data for to drive dashboard and reports. Our Init Block query is very quick and while are constantly asking the DB the same query Oracle caches it's results so the bverhead is near to nothing.

  • MDX Query much slower for users without administrativ rights

    We have a SQL 2012 SP1 with CU9 installed and run a MDX query against a Cube. The Problem is that the query runs very slow for a user without administrativ persmission on the cube. With admin rights it takes 3 seconds and without 30 seconds. I can't find
    any error in the query so maybe someone can pin point me in the right direction.The Role has all reading information it needs.
    This is the Query:
    SELECT NON EMPTY { [Measures].[Blocked Consignment], [Measures].[Consignment in Inspection],
    [Measures].[Restricted Consignment], [Measures].[Unrestricted Consignment] } ON COLUMNS, NON EMPTY
    { ([Date].[Date].[Date].ALLMEMBERS * [Materials].[Part Number].[Part Number].ALLMEMBERS *
    [Materials].[Key].[Key].ALLMEMBERS * [Sold To].[Name].[Name].ALLMEMBERS *
    [Stock Information].[Plant - Storage Location].[Storage Location].ALLMEMBERS * [Non Zero].[Zero Stock Status].[Zero Stock Status].ALLMEMBERS ) }
    ON ROWS
    FROM ( SELECT ( STRTOSET("[Non Zero].[Zero Stock Status].&[No]", CONSTRAINED) )
    ON COLUMNS FROM ( SELECT ( STRTOSET("[Stock Information].[Storage Location].&[1090]", CONSTRAINED) )
    ON COLUMNS FROM ( SELECT ( STRTOSET("[Stock Information].[Plant].&[1090]", CONSTRAINED) )
    ON COLUMNS FROM ( SELECT ( STRTOSET("[Sold To].[Name].[All]", CONSTRAINED) )
    ON COLUMNS FROM [Stock Snapshot]))))
    WHERE ( IIF( STRTOSET("[Stock Information].[Plant].&[1090]", CONSTRAINED).Count = 1, STRTOSET("[Stock Information].[Plant].&[1090]", CONSTRAINED), [Stock Information].[Plant].currentmember ),
    IIF( STRTOSET("[Stock Information].[Storage Location].&[1090]", CONSTRAINED).Count = 1, STRTOSET("[Stock Information].[Storage Location].&[1090]", CONSTRAINED), [Stock Information].[Storage Location].currentmember ) )
    Any one came across this is or is it a bug?

    Can you check which build of SSAS you've got installed? It looks similar to this bug:
    http://support.microsoft.com/kb/2905298/en-us
    Apart from that, if you have used cell security in your role, it would be expected that query performance would be slower for users of that role.
    Chris
    Check out my MS BI blog I also do
    SSAS, PowerPivot, MDX and DAX consultancy
    and run public SQL Server and BI training courses in the UK

  • XML Init Blocks

    Hello,
    Does anyone know how to use XML as a source for a dynamic repository variable? In the init block data source dialog, there is an XML option in the type dropdown. When I select this and point to an XML connection pool (which works correctly for accessing data through the RPD layers) and try to run a query I get one of the following errors, depending on the syntax I try:
    [nQSError: 59112] Operation is not supported for data source connectivity type: NQSXML.
    [nQSError: 27024]The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute.
    I've tried submitting normal SQL, X-Path expressions and a mixture of the two, but nothing works. Has anyone had any luck implementing this?
    Thanks.

    It can't be done. Oracle has disabled the ability to do this due to a bug. You can only read from connection pools that are ODBC or database-based.

  • Repository variable and Init block

    I created an Init block that is based off of a sql command in which the command is designed to give me the max date a table was updated after a data load.  Well the variable I created based off of this has a timestamp of today's date.  I want to create a report on the front end (actually just a column) that updates when a load has been completed.  I use this (TIMESTAMPDIFF ( SQL_TSI_MINUTE, VALUEOF(“LAST_UPDATE_DATE”)), CURRENT_TIMESTAMP)) for the column formula but I'm either running into errors or getting nothing at all.
    OBIEE 11.1.1.5
    Please Advise

    Hey......long time but here it is.   So I created an init block called Last_update_date and had it query a db table that automatically updates when a data load is complete.  I set a variable with the current timestamp.  Well When the table loads the variable locks in that time of the load.   On the front end I referenced the table in an expression and created a report around it.  I did a timestamp diff b/t current time and the time the init block locked in for the load, and called it ETL update column.  I created an agent that starts a purging/caching cascade with the ETL update report as the condition.
    Thanks

  • Filters not getting passed in MDX query while using SAP BW with OBIEE

    Hello,
    I've been working on OBIEE with SAP BW as back-end. I've created some reports & those are working fine when there is less amount of data. But when I try to run a report with 3 dimensions & 1 fact it throws an error saying "No more storage space available for extending an internal table". When I checked MDX query, I found that the filters that I had applied to request & also selected from prompts are not getting passed in that query. So, I tried running a simple request using a simple filter in Answers. Although this request returns results but I can't see filter conditions in query. MDX query always show crossjoin but I can't see filter conditions anywhere.
    Is it the normal OBIEE behaviour OR am I doing something wrong in there? Can you please help me out with this?
    Thanks,
    Rocky

    Hello Sainath,
    We tried those things. But it is still giving same error.
    State: HY00. Code: 10058. [NQODBC][SQL_STATE:HY000][nQSError: 10058] A general error has occurred. XML/A error returned from the server: Fault code: "XMLAnalysisError.0X80000005". Fault string: "The XML for Analysis provider encountered an error: MDX result contains too many cells (more than 1 million)". (HY000)
    The problem here, I think, is the filter parameters are not getting passed in the MDX query. Any idea why would that happen? Is there any setting to do so?
    Thanks in advance for help.
    Regards,
    Rocky

Maybe you are looking for

  • How would i use 'find my iphone' to locate my husband's ipad?

    My husband and i would like to be able to find each other's device, (iphone 4 and ipad) by using 'find my iphone'. We frequently lose each other. How would we set that up? Thanks!

  • Urgent - Error F5 702 at MIRO only for subcontracting PO's

    Hi, I got the message F5 702, regarding exchange rates differences at invoice receipt, but it just happens por subcontracting PO's and even if all the process is in EUR, there are no exchange rates taking place. There are a couple of threads and sap

  • Server 2012: Windows Internal Database error during installation

    I am using the current RC build. While trying to install IPAM services, I am prompted to install a Windows Internal Database. However, setup consistently dies on me with an error that "The operation could not be completed, because the server that you

  • How can I install the plugins?

    Please somebody help me figure out how I can install the MSAccess.jar plugin needed for setting up the omwb after the creation of the repository. MSAccess.jar is in the plugins folder. Why doesnt it work? Thanks!

  • Why won't my iPad update

    My iPad won't update!!!   The newest version and the one I'm trying to get is 7.1.2. The Install now button is there but when I click it it has me enter my passcode then I agree to terms of service (which I think are just stupid because no one reads