I have only done basic queries using MDX and now I am in a spot of trouble. I am trying to query data from a cube and want the data returned to be based on elements that do not appear in the result set. I have made a similar query against the Foodmart cube.
This one works
SELECT
{
[Store].[USA].[CA], [Store].[USA].[OR], [Store].[USA].[WA]
}
ON COLUMNS,
{
[Time].[1997]
}
ON ROWS
FROM Sales
WHERE (
[Measures].[Profit],
[Product].[Food].[Baking Goods].[Jams and Jellies].[Jam].[Super]
)
But what I want to do is have the where clause filter by more than [Jam].[Super], I would like to roll up the filter to include multiples i.e [Jam].[Plato], [Jam].[Super], [Jam].[CDR], in SQL I could just use WHERE Brand IN (Plato, Super, CDR) But I know the where statement works in a diffent way in MDX. From what i have read in msdn articles this should work but it throws the error
'cannot convert set to tuple in the - { } function'
SELECT
{
[Store].[USA].[CA], [Store].[USA].[OR], [Store].[USA].[WA]
}
ON COLUMNS,
{
[Time].[1997]
}
ON ROWS
FROM Sales
WHERE
{
([Measures].[Profit],
[Product].[Food].[Baking Goods].[Jams and Jellies].[Jam].[Super]),
([Measures].[Profit],
[Product].[Food].[Baking Goods].[Jams and Jellies].[Jam].[Plato])
}
This may be caused because I am including the measure in the where clause? This where i need the measure data.
Can anyone help me with this?
I would really appreciate it.
This one works
SELECT
{
[Store].[USA].[CA], [Store].[USA].[OR], [Store].[USA].[WA]
}
ON COLUMNS,
{
[Time].[1997]
}
ON ROWS
FROM Sales
WHERE (
[Measures].[Profit],
[Product].[Food].[Baking Goods].[Jams and Jellies].[Jam].[Super]
)
But what I want to do is have the where clause filter by more than [Jam].[Super], I would like to roll up the filter to include multiples i.e [Jam].[Plato], [Jam].[Super], [Jam].[CDR], in SQL I could just use WHERE Brand IN (Plato, Super, CDR) But I know the where statement works in a diffent way in MDX. From what i have read in msdn articles this should work but it throws the error
'cannot convert set to tuple in the - { } function'
SELECT
{
[Store].[USA].[CA], [Store].[USA].[OR], [Store].[USA].[WA]
}
ON COLUMNS,
{
[Time].[1997]
}
ON ROWS
FROM Sales
WHERE
{
([Measures].[Profit],
[Product].[Food].[Baking Goods].[Jams and Jellies].[Jam].[Super]),
([Measures].[Profit],
[Product].[Food].[Baking Goods].[Jams and Jellies].[Jam].[Plato])
}
This may be caused because I am including the measure in the where clause? This where i need the measure data.
Can anyone help me with this?
I would really appreciate it.