Been a *looong* while since I've been on here, and I some seeking your advice on MDX



Q: How do you pass the resulting set from a Summary dimension's MDX statement as the starting point for a Detail dimension's MDX statement?
Consider this example:
- 1) Dimension "Summary" contains a hierarchy of Country > City
2) Dimension "Detail" contains a hierarchy City > Office
3) Principal element names for 'Country' in both dimensions are identical
The puzzle is thus:
- 1) Perform an MDX query on the "Summary" dimension
- a) Filter by wildcard country e.g. "UK"
b) Expand out to find all cities within "UK"
c) This is done with the MDX query below:
- a) Filter by wildcard country e.g. "UK"
Code: Select all
{TM1DRILLDOWNMEMBER( {TM1FILTERBYPATTERN( {TM1SUBSETALL( [Summary] )}, "UK")}, ALL, RECURSIVE )}
- 2) Perform an MDX query on the "Detail" dimension
- a) Start with the cities resulting from query above
b) Expand out to find all offices within these cities
- a) Start with the cities resulting from query above
Code: Select all
HOW CAN THIS BE DONE...?
The concept of using a subset of one dimension to drive a subset in another feels sound - indeed it is entirely possible to copy-paste the results of the first query into subset editor on the second dimension manually.
I am trying to avoid the use of TI to generate 2 separate subsets, having to loop through the first to ascertain the second if possible, as I want the second subset to be the source for a TI itself. Similarly, I want to avoid creating a technical dimension which munges together these to shiny clean ones.
TIA
TM1 Dunk
PS: If/when I get this to work, I might have some snazzy code to share with the good folk of the TM1Forum...
