MDX Query: Equivalent of SQL's "IN" clause
Hi,
In SQL, we have an option of viewing data of multiple members by specifying IN as follows:
SELECT column1 from TABLE WHERE
column2 in ('value1','value2');
Is there any equivalent of that in MDX?
Let's say my outline is like this:
--Products (Standard Dimension)
|_____Computers (+)
|_____ Televisions (+)
|_____Others (+)
--Regions (Standard Dimension)
|_____North(+)
|_____ South (+)
|_____East(+)
|_____West(+)
--Measures (Accounts Dimension)
|_____Estimate Sales
|_____Actual Sales
I would like to answer this question:
What is the actual sales and estimate sales of each product in "North" and "East" regions?
If the region constraint is not there, the MDX query would be:
SELECT Products.Members on Rows
{[Estimate Sales], [Actual Sales]} on Columns
from appName.dbName
How do I modify this query to include only North and East regions, and still selecting product on rows?
Thanks in advance.
Regards,
Vivek Ganesan
Just add a where condition:
WHERE
({[Regions].[North], [Regions].[East})
for more info:
Member range specification:
http://docs.oracle.com/cd/E12825_01/epm.111/esb_techref/mdx_memberrange.htm
Slicer specification:
http://docs.oracle.com/cd/E12825_01/epm.111/esb_techref/mdx_slicer_spec.htm
Hope this helps
Similar Messages
-
MDX query runs on SQL but does not populate 'Measures' in Powerpivot
I ran MDX query on SQL 2012 for looking the products and their shipping status
The code is given below:
WITH
set Date1 AS
strtomember( "[Time].[2014].[Q4].[2014-Jun].[" +format(now()-2, "MM") + "/"+format(now()-2, "dd") + "/" +format(now()-2, "yyyy") + "]")
set Item1 as
{ [Item].[ItemID].ALLMEMBERS}
SELECT NON EMPTY { [Measures].[Shipped Qty], [Measures].[Shipped Amt], [Measures].[Ordered Qty], [Measures].[Ordered Amt] }
ON COLUMNS,
Date1*[Item1] ON ROWS FROM [ABCD]
WHERE (
[Channel].&[OL],
[Geography].&[A.9])
The query gives desired output when run in SQL. But when I run the same query in while pulling data in PowerPivot, Dimensions i.e. Date and Item are populated but measures were not populated. Can anyone please help me understand how to populated Measures
in PowerPivot?
Hi apoorv,
It was hard to reproduce this issue on my test environment. I would suggest you try to use a simple MDX query to check if it will retrun the correct measures data. Please see the screenshot below:
In addition, you can also create a SQL Server Analysis Services trace to capture some events for furhter investigation.
Use SQL Server Profiler to Monitor Analysis Services:http://technet.microsoft.com/en-us/library/ms174946.aspx
Hope this helps.
Elvis Long
TechNet Community Support -
Converting MDX query into SQL Server 2008
We have MDX query based OLAP CUbes.
To reduce MDX based dependenies, we have to convert MDX based cube to sql server 2008 based queries.
For this I need expert advise to convert below query to sql server 2008 based query :
CREATE MEMBER CURRENTCUBE.Measures.[Ack Lost]
AS 'Sum(PeriodsToDate([Time].[Year], [Time].CurrentMember ), [Measures].[Lost])',
FORMAT_STRING = "#,#",
VISIBLE = 1;Hi Sachin,
According to your description, you need to convert the MDX query to T-SQL query, right?
Your MDX query is calculated measure that return the total value from the first sibling and ending with the given member. In T-SQL query we can use the query as Yogisha provided to achieve the same requirement. Now you need to a tool to convert all the MDX
related SSAS cube queries to MS SQL Server 2008 based queries.
Although MDX has some similarities with T-SQL these languages are in many ways different. Beginning to learn and comprehend SQL Server Analysis Services (SSAS) MDX queries can be difficult after one has spent years writing queries in T-SQL. Currently, there
is no such a tool to convert a MDX query to T-SQL query since the structure difference between MDX and T-SQL. So you need to convert them manually, please refer to the links below to see the details.
http://www.mssqltips.com/sqlservertip/2916/comparison-of-queries-written-in-tsql-and-sql-server-mdx/
https://sqlmate.wordpress.com/2013/11/12/t-sql-vs-mdx-2/
http://technet.microsoft.com/en-us/library/aa216779(v=sql.80).aspx
Regards,
Charlie Liao
TechNet Community Support -
Declare variables in an MDX query
Is it possible to declare variables in an MDX query like transact sql? something like this:
DECLARE @date1 date
DECLARE @month1 int
set @date1 = '12-12-2012'
set @month1=DATEPART(m, @date1)-1
select @date1 as dt1, @mesreferencia as mt1Hi ,
In MDX , you will not be able to put variables in MDX. But Query scoped calculated measures can be used for such cases. The equivalent MDX for the above is
WITH MEMBER [MEASURES].Dt
As
CDATE('12-12-2012')
MEMBER MEASURES.DTPart
As
DATEPART("M", MEASURES.Dt)-1
SELECT {MEASURES.Dt,MEASURES.DTPart} ON 0
FROM [Adventure Works]
Best Regards Sorna -
Find current age from day in mdx query
Hi,
I need to find current age.In my cube i have dob attribute.
so how can i find current age from day using mdx query.
Thanks,
Indu
induHi,
when i ran above query, i am getting days.
But i need current age in years.
so i tried with below query, then i am getting value like 8.99.how can i round off in mdx query?
in sql i used Floor function for roundoff. in mdx which function should i use?
With
MEMBER [DOB] AS DATEDIFF('d',[Ship Date].[Date].CurrentMember.Name,Now())/365.25
Select {[DOB]}
on columns ,
NON
EMPTY {[Ship Date].[Date].[Date]}
ON ROWS From [Adventure Works]
indu -
SQL query in SQL_REDO Logminor showing where clause with ROWID
SQL query in SQL_REDO Logminor showing where clause with ROWID. I dont wanted to use rowid but wanted to use actual value.
OPERATION SQL_REDO SQL_UNDO
DELETE delete from "OE"."ORDERS" insert into "OE"."ORDERS"
where "ORDER_ID" = '2413' ("ORDER_ID","ORDER_MODE",
and "ORDER_MODE" = 'direct' "CUSTOMER_ID","ORDER_STATUS",
and "CUSTOMER_ID" = '101' "ORDER_TOTAL","SALES_REP_ID",
and "ORDER_STATUS" = '5' "PROMOTION_ID")
and "ORDER_TOTAL" = '48552' values ('2413','direct','101',
and "SALES_REP_ID" = '161' '5','48552','161',NULL);
and "PROMOTION_ID" IS NULL
and ROWID = 'AAAHTCAABAAAZAPAAN';
DELETE delete from "OE"."ORDERS" insert into "OE"."ORDERS"
where "ORDER_ID" = '2430' ("ORDER_ID","ORDER_MODE",
and "ORDER_MODE" = 'direct' "CUSTOMER_ID","ORDER_STATUS",
and "CUSTOMER_ID" = '101' "ORDER_TOTAL","SALES_REP_ID",
and "ORDER_STATUS" = '8' "PROMOTION_ID")
and "ORDER_TOTAL" = '29669.9' values('2430','direct','101',
and "SALES_REP_ID" = '159' '8','29669.9','159',NULL);
and "PROMOTION_ID" IS NULL
and ROWID = 'AAAHTCAABAAAZAPAAe';
Please let me know solution/document which will convert SQL redo rowid value with actual value.
Thanks,Please enclose your output within tag so that people here can read it easily and help you. Also the reason that why you want to remove rowid?
Salman
Edited by: Salman Qureshi on Mar 20, 2013 3:53 PM -
Simple sql to mdx query using the max fn
I'm using the MDX Max fn to get the max of a certain value but now I want get max for a certain pair of values and not all, how could i write this in mdx as a calculation?
More details: For a certain pair of status and substatus (status=1, substatus=1) from a trans dimension table i want to get the max insertionid (attribute in trans measure table). How would you guys suggest I go about this?
I'm new to mdx and I'm converting a whole sql statement to a measure not to include it as a named query for performance concerns!
If needed this is the sql query im converting:
SELECT TOP (1) InsertionDT
FROM dbo.TransTasksFFMS_GVT AS TSI
WHERE (TaskCode = T.TaskCode) AND (TaskStatus = 1) AND (TaskSubStatus = 1)
ORDER BY InsertionDT) AS RegistrationTimeWithoutConversion
Another way to think of this is how to apply a certain measure only on certain values and not all values in the browser.Hi Junior,
According to your description, you want to get the max value by using MDX query, right? Since no know your cube detail information, we cannot convert this T-SQL to MDX query. Here is a sample MDX query for your reference. The query below returns the Sale
Amount measure and the MaxValue calculated member. The MaxValue calculated member takes the maximum value for members of the Fiscal Year level in the Fiscal hierarchy of the Date dimension.
WITH
MEMBER [Measures].[MaxValue] AS
MAX([Date].[Fiscal].[Fiscal Year].Members, [Measures].[Sales Amount])
SELECT
{[Measures].[Sales Amount],[Measures].[MaxValue]} ON COLUMNS,
{[Date].[Fiscal].[Fiscal Year].Members} ON ROWS
FROM
[Adventure Works]
Reference:Max (MDX)
Regards,
Charlie Liao
TechNet Community Support -
How to convert MDX query to SQL
Hi everyone,
can you please suggest me, how to convert the below mdx query to sql query. can you please tell me what it is doing?
CREATE MEMBER CURRENTCUBE.[Measures].[calculation]
AS IIF(([Measures].[Clear Call Count],[Trouble Code].[Is Battery].&[Battery T-Code],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark]) = 0, NULL,
([Measures].[ Total Shipped],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark])/
([Measures].[Clear Call Count],[Trouble Code].[Is Battery].&[Battery T-Code],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark])),
FORMAT_STRING = "Percent",
VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Sale';
Thanks
VishuHi Vishu,
As Olaf said, this is a calculated member which used in MDX script in your cube, we cannot execute it in SQL Server Management Studio directly. Here are some document about calculated members and MDX script for your reference.
Defining Calculated Members
MDX Scripting Fundamentals (Analysis Services)
Regards,
Charlie Liao
TechNet Community Support -
SQL Query help ( On connect By level clause)
Hi all,
I have this query developed with data in with clause.
With dat As
select '@AAA @SSS @DDD' col1 from dual union all
select '@ZZZ @XXX @TTT @RRR @ZZA' col1 from dual
Select regexp_substr( col1 , '[^@][A-Z]+',1,level) Show from dat
connect by level <= regexp_count(col1, '@');Current output :-
SHOW
AAA
SSS
DDD
RRR
ZZA
TTT
RRR
ZZA
XXX
DDD
RRR
SHOW
ZZA
TTT
RRR
ZZA
. . .1st row comes fine, But next row data is getting duplicated. And total record count = 30. I tried with some but didn't work.
Expected output :-
SHOW
AAA
SSS
DDD
ZZZ
XXX
TTT
RRR
ZZAI need some change on my query and I am not able to find that. So anybody can add on that or can also provide some different solution too.
Thanks!
AshutoshHi,
When you use something like "CONNECT BY LEVEL <= x", then at least one of the following must be true:
(a) the table has no more than 1 row
(b) there are other conditions in the CONNECT BY clause, or
(c) you know what you are doing.
To help see why, run this query
SELECT SYS_CONNECT_BY_PATH (dname, '/') AS path
, LEVEL
FROM scott.dept
CONNECT BY LEVEL <= 3
;and study the results:
PATH LEVEL
/ACCOUNTING 1
/ACCOUNTING/ACCOUNTING 2
/ACCOUNTING/ACCOUNTING/ACCOUNTING 3
/ACCOUNTING/ACCOUNTING/RESEARCH 3
/ACCOUNTING/ACCOUNTING/SALES 3
/ACCOUNTING/ACCOUNTING/OPERATIONS 3
/ACCOUNTING/RESEARCH 2
/ACCOUNTING/RESEARCH/ACCOUNTING 3
/ACCOUNTING/RESEARCH/RESEARCH 3
/ACCOUNTING/RESEARCH/SALES 3
/ACCOUNTING/RESEARCH/OPERATIONS 3
/ACCOUNTING/SALES 2
/ACCOUNTING/SALES/ACCOUNTING 3
84 rows selected. -
How to union results from 3 different dimensions in where clause with or - Mdx query
Hi
I have a MDX Query and i need to pass the variable values to it by dynamically.
Each time it will get any one attribute from three dimensions.
Select
{} ON Columns,
{} ON Rows
From
Cube
Where
[Dimension1].[Attribut].&[Value]
or
[Dimension2].[Attribut2].&[Value]
or
[Dimension3].[Attribut3].&[Value]
So It is working for two different values by using union and cross join.
Can you please provide the solution ..
Thanks in advanceHi Philip
Thanks for replying me.
I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The Hierarchy already appears in Axis1".
SELECT
{[Measures].[Internet Sales Amount] } ON 0,
NON EMPTY
{[Customer].[Gender].allmembers } ON 1 -- Used
FROM
[Adventure Works]
WHERE
[Customer].[Gender].&[M]
,[Product].[Size Range].[(All)]
,[Customer].[Country].[All Customers]
[Customer].[Gender].[All Customers]
,[Product].[Size Range].&[XL]
,[Customer].[Country].[All Customers]
[Customer].[Gender].[All Customers]
,[Product].[Size Range].[(All)]
,[Customer].[Country].&[Australia]
Can you provide alternate ways to get resolved.
Thanks in advance -
MDX Query - Rolling Up A Case Statement
Hi,
I have the following query
with
member measures.[EmployeeNumber] as [Employee].[EmployeeNumber].currentmember.member_name
member measures.[Type] as Case When [WorkDay].[DayOfWeek].currentmember.member_name = "Sunday" Then "PenaltyRate" Else "Standard" End
Select {
measures.[EmployeeNumber]
, measures.[Type]
, measures.[ContactHours]
} on 0,
non empty
[Employee].[EmployeeNumber].[all].children*
[WorkDay].[DayOfWeek].[all].children
Having measures.[ContactHours] <> 0
on 1
From MyCube
and I want write a MDX query that takes this result set and sums that ContactHours per EmployeeNumber and per Type i.e. excluding the WorkDay.DayOfWeek hierarchy from the results.
This would be the same as doing
Select Sum(ContactHours), EmployeeNumber, Type
From ResultsSet
Group By EmployeeNumber, Type
in SQL.Hi Joerne,
According to your description, you want to get a MDX query which equivalent of a GROUP BY in T-SQL, right? In this case, please refer to the link below to see the article which give out some sample query in MDX that equivalent of a filtered GROUP BY in T-SQL.
MDX equivalent of a filtered GROUP BY in SQL
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support -
Oracle equivalent to SQL Server Table Variables ?
Does Oracle have anything equivalent to SQL Server table variables, that can be used in the JOIN clause of a select statement ?
What I want to do is execute a query to retrieve a two-column result, into some form of temporary storage (a collection ?), and then re-use that common data in many other queries inside a PL/SQL block. I could use temporary tables, but I'd like to avoid having to create new tables in the database, if possible. If I was doing this in SQL Server, I could use a table variable to do this, but is there anything similar in Oracle ? SQL Server example:
use Northwind
DECLARE @myVar TABLE(CustomerID nchar(5), CompanyName nvarchar(40))
INSERT INTO @myVar(CustomerID, CompanyName)
select CustomerID, CompanyName
from Customers
--Join the variable onto a table in the database
SELECT *
FROM @myVar mv join Customers
on mv.CompanyName = Customers.CompanyName
The closest I've found in Oracle is to use CREATE TYPE to create new types in the database, and use TABLE and CAST to convert the collection to a table, as shown below. I can't see anyway without creating new types in the database.
CREATE TYPE IDMap_obj AS Object(OldID number(15), NewID number(15));
CREATE TYPE IDMap_TAB IS TABLE OF IDMap_obj;
DECLARE
v_Count Number(10) := 0;
--Initialize empty collection
SourceIDMap IDMap_TAB := IDMap_TAB();
BEGIN
--Populate our SourceIDMap variable (dummy select statement for now).
FOR cur_row IN (select ID As OldID, ID + 10000000 As NewID From SomeTable) LOOP
SourceIDMap.extend;
SourceIDMap(SourceIDMap.Last) := IDMap_obj(cur_row.OldId, cur_row.NewId);
END LOOP;
--Print out contents of collection
FOR cur_row IN 1 .. SourceIDMap.Count LOOP
DBMS_OUTPUT.put_line(SourceIDMap(cur_row).OldId || ' ' || SourceIDMap(cur_row).NewId);
END LOOP;
--OK, can we now use our collection in a JOIN statement ?
SELECT COUNT(SM.NewID)
INTO v_Count
FROM SomeTable ST JOIN
TABLE(CAST(SourceIDMap As IDMap_TAB)) SM
ON ST.ID = SM.OldID;
DBMS_OUTPUT.put_line(' ' );
DBMS_OUTPUT.put_line('v_Count is ' || v_Count);
END;Hi, got this from our plsql guys:
The term "table function" is a bit confusing here. In Oracle-speak, it means a function that can be used in the from list of a select statement thus:
select * from Table(My_Table_Function()),..
where...
The function's return type must be a collection that SQL understands. So for the interesting case -- mimicking a function with more than one column -- this would be a nested table of ADTs where both the ADT and the nested table are defined at schema level. PL/SQL -- by virtue of some clever footwork -- allows you to declare the type as a nested table of records where both these types are declared in a package spec. This alternative is generally preferred, especially because the nested table can be of Some_Table%rowtype (or Some_Cursor%rowtype if you prefer).
As I understand it from our man on the ANSI committee, our use terminology follows the standard.
The construct below seems to be a bit different (though there are similarities) because it appears from your code sample that it's usable only within procedural code. And the object from which you select is a variable rather than a function.
So, after that preamble... the answer would be:
No, we don't have any constructs to let you "declare" something that looks like a regular schema-level table as a PL/SQL variable -- and then use (static) SQL on it just as if it were a schema-level table.
But yes, you can use PL/SQL's pipelined table function to achieve much of the same effect.
Look at the attached Table_Function.sql.
It shows that you can populate a collection of records using ordinary PL/SQL code. You can't use SQL for insert, update, or delete on such a collection. I see that SQL Server lets you do
insert into Program_Variable_Table select... from Schema_Level_Table
The PL/SQL equivalent would be
select...
bulk collect into Program_Variable_Collection
from Schema_Level_Table
The attached shows that once you have populated your collection, then you can then query it with regular SQL -- both from inside PL/SQL code and from naked SQL.
and the code is here
CONNECT System/p
-- Drop and re-create "ordinary" user Usr
EXECUTE d.u
CONNECT Usr/p
create table Schema_Things(ID number, Description Varchar2(80))
create package Pkg is
subtype Thing_t is Schema_Things%rowtype;
type Things_t is table of Thing_t; -- index by pls_integer
Things Things_t;
-- PLS-00630: pipelined functions must have
-- a supported collection return type
-- for "type Things_t is table of Thing_t index by pls_integer".
function Computed_Things return Things_t pipelined;
procedure Insert_Schema_Things(No_Of_Rows in pls_integer);
end Pkg;
create package body Pkg is
function Computed_Things return Things_t pipelined is
Idx pls_integer;
Thing Thing_t;
begin
Idx := Things.First();
while Idx is not null loop
pipe row (Things(Idx));
Idx := Things.Next(Idx);
end loop;
end Computed_Things;
procedure Insert_Schema_Things(No_Of_Rows in pls_integer) is
begin
Things := Things_t();
Things.Extend(No_Of_Rows);
for j in 1..No_Of_Rows loop
Things(j).ID := j;
Things(j).Description := To_Char(j, '00009');
end loop;
insert into Schema_Things
select * from Table(Pkg.Computed_Things());
end Insert_Schema_Things;
end Pkg;
-- Test 1.
begin Pkg.Insert_Schema_Things(100); end;
select * from Schema_Things
-- Test 2.
begin
Pkg.Things := Pkg.Things_t();
Pkg.Things.Extend(20);
for j in 1..20 loop
Pkg.Things(j).ID := j;
Pkg.Things(j).Description := To_Char(j, '00009');
end loop;
for j in 1..5 loop
Pkg.Things.Delete(5 +2*j);
end loop;
end;
select * from Table(Pkg.Computed_Things())
/ -
SSRS report with cube – MDX query how to get an extra row with value '0'.
Hello everyone,
I'm unable to write the MDX query to get '0' value as first row in output. Following is my MDX query:
WITH MEMBER [Measures].[Dummy] AS '0'
SELECT NON EMPTY Union( {[Measures].[Amount] },{[Measures].[Dummy]}) ON COLUMNS,
NON EMPTY { ([Customer].[Customer Nbr].[Customer Nbr].ALLMEMBERS * [Fiscal].[Year].[Year].ALLMEMBERS ) }
having [Measures].[Amount] > 5000
ON ROWS FROM [cube]
With above query, the output returns the value '0' as a separate column.
I would like to get it in form of first row for [Measures].[Amount]. Like,
Amount
0
500
200
100
What needs to be changed to achieve the above result? I'm planning to use the above value in line chart to start the line from 0th value as described in following URL. (Note: The below URL is using SQL query and not MDX expressions.)
http://spinerain.blogspot.in/2013/09/ssrs-line-chart-create-stacked-line-and.html
Thanks, Ankit Shah
Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.htmlThe round brackets in your expression are forcing an implicit crossjoin between the 3 lines. I would do the following which creates a set of the DummyYear plus the real year members and then crossjoin that with the customer set.
WITH MEMBER [Fiscal].[Year].DummyYear AS '0'
SELECT NON EMPTY {[Measures].[Amount]} ON COLUMNS,
NON EMPTY {[Fiscal].[Year].DummyYear,
[Fiscal].[Year].[Year].MEMBERS} *
[Customer].[Customer Nbr].[Customer Nbr].MEMBERS
having [Measures].[Amount] > 5000
ON ROWS FROM [cube]
http://darren.gosbell.com - please mark correct answers -
How to get the child data in MDX query?
I have an MDX query that will return the data for an OLAP report. These report data include the parent_id, child_id and some dimensions data in it. How do I modify the MDX query to have a New member to show a dimension value of the child_id.
The child_is is actually the parent_id on another row. It is the "Pstpd Decision" I want to be included in a new column using the "Appeal Id". Thanks
WITH MEMBER [Measures].[Avg TA Time] AS [Measures].[Turn Around Time]/[Measures].[Number of Request]
SELECT NON EMPTY { [Measures].[Number of Request] } ON COLUMNS,
NON EMPTY { ([Request Date Time].[FY-AP].[Account Period].ALLMEMBERS *
[Request Drugs].[Drug Generic Name].[Drug Generic Name].ALLMEMBERS *
[Dispensary].[Dispensary Hierarchy].[Dispensary].ALLMEMBERS *
[Disease].[Tumour Group Site].[Tumour Group Site].ALLMEMBERS *
[Disease].[Tumour Group Sub Site].[Tumour Group Sub Site].ALLMEMBERS *
[Patient].[Patient Agency ID].[Patient Agency ID].ALLMEMBERS *
[Pstpd Decision].[Decision].[Decision].ALLMEMBERS *
[Request].[Request Id Key].[Request Id Key].ALLMEMBERS *
[Request].[Appeal Id].[Appeal Id].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM ( SELECT ( { [Appeal Yes No].[Status].&[Yes] } ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED) ) ON COLUMNS
FROM [CAP Request])) WHERE ( IIF( STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED).Count = 1, STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED), [Request Date Time].[Fiscal Year].currentmember ), [Appeal Yes No].[Status].&[Yes] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
data.
KahluaI got it to work by adding the child_id's "decison' to the fact table as it is alot easier to get that data using Sql Script while creating the fact table and also there is already a "decsion" dimension setup. In the cube I can select the
parent_id's decision and/or child_id's decision. It is working on the report. Thanks.
Kahlua -
When using TODATE function MDX query is not correctly generated
Essbase 9.3.1.2 and OBIEE 10.1.3.4.1.
When using TODATE function MDX query is not correctly generated.
This leads to unexpected values not only on cumulative columns in report (generated with TODATE), but also other columns (calculated with AGO function or directly read from cube) have incorrect values.
The problem occurs when you filter on a column that is not in the select list. If you filter on just one level of dimension, results are fine. You can filter on multiple dimensions as long as you filter on just one level of each dimension.
If you filter on two or more levels of one dimension, than results are not correct. In some cases results for TODATE column are all zeros, in some cases it is a random value returned by Essbase (same random value for all rows of that column), and in some cases BI Server returns an error:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. Essbase Error: Network error [10054]: Cannot Send Data (HY000).
Here is generated MDX code:
With
set [Grupe proizvoda2] as '{[Grupe proizvoda].[N4]}'
set [Grupe proizvoda4] as 'Generate([Grupe proizvoda2], Descendants([Grupe proizvoda].currentmember, [Grupe proizvoda].Generations(4), leaves))'
set [Segmentacija2] as '{[Segmentacija].[RETAIL]}'
set [Segmentacija4] as 'Filter(Generate({[Segmentacija2]}, Descendants([Segmentacija].currentmember, [Segmentacija].Generations(4),SELF), ALL), ([Segmentacija].CurrentMember IS [Segmentacija].[AFFLUENT]))'
set [Vrijeme3] as '{[Vrijeme].[MJESEC_4_2009]}'
member [Segmentacija].[SegmentacijaCustomGroup]as 'Sum([Segmentacija4])', SOLVE_ORDER = AGGREGATION_SOLVEORDER
member [Accounts].[MS1] as '(ParallelPeriod([Vrijeme].[Gen3,Vrijeme],2,[Vrijeme].currentmember), [Accounts].[Trosak kapitala])'
member [Accounts].[MS2] as '(ParallelPeriod([Vrijeme].[Gen3,Vrijeme],1,[Vrijeme].currentmember), [Accounts].[Trosak kapitala])'
member [Accounts].[MS3] as 'AGGREGATE({PeriodsToDate([Vrijeme].[Gen2,Vrijeme],[Vrijeme].currentmember)}, [Accounts].[Trosak kapitala])'
select
{ [Accounts].[Trosak kapitala],
[Accounts].[MS1],
[Accounts].[MS2],
[Accounts].[MS3]
} on columns,
NON EMPTY {crossjoin ({[Grupe proizvoda4]},{[Vrijeme3]})} properties ANCESTOR_NAMES, GEN_NUMBER on rows
from [NISE.NISE]
where ([Segmentacija].[SegmentacijaCustomGroup])
If you remove part with TODATE function, the results are fine. If you leave TODATE function, OBIEE returns an error mentioned above. If you manually modify variable SOLVE_ORDER and set value to, for example, 100 instead of AGGREGATION_SOLVEORDER, results are OK.
In all cases when this variable was modified in generated MDX, and query manually executed on Essabse, results were OK. This variable seems to be the possible problem.Hi,
Version is
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
Sorry, in my last post i forgot to mention that i already created a function based index but still it is not using because, there is a UNIQUE constraint on that column.
Thanks
Maybe you are looking for
-
Adobe pdf printer does not appear
I downloaded Adobe Reader 9 to my HP laptop, but the Adobe pdf printer does not appear on the list of available printers. My HP says it has AMD Turion (tm) 64 Mobile Technology ML-34 and Windows XP (Version 2002, Service Pack 2). Can someone tell me
-
Cursor doesn't disappear for full-screen movies.
I believe it only happens when I'm watching something streamed over the internet. It's not limited to the web browser I'm using though. It also disappears sometimes, but very rarely. I thought it was a problem with my iMac but it's happening on my ne
-
Passing Select-options to methods ?
Hi, I want to create a method and pass a select-option to it. How to declare the parameter for this method. regards, Navneeth K.
-
Imessage login error with valid AppleID
I have an iPad 2 with 5.1.1 IOS. I am able to successfully log into the Apps store with my AppleID. I am able to log into the appleid.apple.com site with my Apple ID. However, when I try to log into either iMessage or FaceTime, it complains of an inv
-
I have successfully published my first (video)podcast using iMovie (and iWeb, of course) but when viewing the site it only has an empty box to represent the podcast and no image to go with it. Do you know how I add one - in iMovie or with the help of