I am new to MDX querying and working with multidimensional data, though a project requires me to learn.
We have a cube with a KPI which performs a Lag()
that sums up the number of transactions that have met a requirement, based on a date.
A query would be something like
SELECT
{} on 0,
[Transaction].[Trader].Members HAVING
KPIStatus("REQ") < 0 on 1
FROM
[Cube]
WHERE
[Transaction].[Trade Date].[2014-07-02]
This will output all the traders that fulfill the criteria of the KPI.
From this, I would like to select all the [Transaction].[Trade ID]
for a trader in the result from the above query. I only want the [Transaction].[Trade ID]
in the same date range as earlier, since they are a part of what triggers the KPIGoal
.
I've tried something like
SELECT
[Transaction].[Trader].&[trader_id] HAVING
KPIStatus("REQ") < 0 on 0,
[Transaction].[Trade ID].Members on 1
FROM
[Cube]
WHERE
[Transaction].[Trade Date].[2014-07-02]
but I get a System.OutOfMemoryException. This might be because of low RAM on my computer that SSMS eats up, but is there a better way to execute the query than the above example? Also, I believe this would result in a badly formated result. The trader can have very many trades with unique [Transaction].[Trade ID]
's. What could be a better approach for it?
Bonus question:
What is the difference of getting the results as row/column "headears" instead of values. The first query gives me one column with the result as "headers" such as how the categories below are encapsulated. What does it really mean?