I am currently studying MDX language to query data in Cube. While reading the documentation for the MDX GENERATE
function, I encountered some confusion about how it works.
Here is some context about my Cube structure:
- This is Measures table:
2\. **This is dimension Payment_Dim:**
Query 1:
// test 1
select generate(
[Payment Dim].[Payment Type].[Payment Type].MEMBERS,
{[Measures].[Tip Amount]}
) on 0
from [Taxidb]
Result:
Query 2:
// test 2
select generate(
[Payment Dim].[Payment Type].[Payment Type].MEMBERS,
{([Payment Dim].[Payment Type].currentmember, [Measures].[Tip Amount])}
) on 0
from [Taxidb]
Result:
I would like to understand:
What is the difference between the two queries?
How does the
GENERATE
function behave differently when using[Measures].[Tip Amount]
versus([Payment Dim].[Payment Type].CURRENTMEMBER, [Measures].[Tip Amount])
?
Thank you so much for your help!