Ranking Cube Methodology
Posted: Thu Oct 13, 2011 12:54 pm
Been having a think about how to do something and come up with a couple of options but open to suggestion if anyone can think of a quicker/more efficient way of completing this problem given the uselessness of MAX functions in current version (9.0 / 9.1).
In essence, I have consolidation A which in turn has 3 consolidations (B, C, D) under it with values as follows -
A 1000
B 300
C 150
D 550
I need to transfer this to a seperate 2 dim cube (dim above and another with three elements for Rank 1, 2 & 3) which ranks the data by numerical order so that in this cube it looks something like this -
Rank 1 Rank 2 Rank 3
A 550 300 150
B ---- 300 -----
C ---- ----- 150
D 550 ----- -----
Obviously in reality it's far more complex but that's the fundamental root of the problem.
I've debated a few ways and the best I've come up with so far is to TI run an ELCOMPN on A to get no. children, SubsetCreatebyMDX against the .Children to sort the data numerically and then run through a while loop using SUBNM against this new MDX created subset to load to each rank in order (whilst deleting generated sub each run and all the other normal malarky), etc.
Only problem is that it's a large, complicated cube it's pulling data from and a massive data set it's processing. It's not the fastest process in the world, even when dumping the data into a trimmed down staging post cube.
Any other simpler ideas? Been through the though process of IF/While/etc looping (yuk), Excel VBA based manipulation (double yuk) and a few even more ridiculous thought processes and best idea so far seems to be the MDX basis.
Anyone got any simpler / more efficient thoughts on this?
TIA
In essence, I have consolidation A which in turn has 3 consolidations (B, C, D) under it with values as follows -
A 1000
B 300
C 150
D 550
I need to transfer this to a seperate 2 dim cube (dim above and another with three elements for Rank 1, 2 & 3) which ranks the data by numerical order so that in this cube it looks something like this -
Rank 1 Rank 2 Rank 3
A 550 300 150
B ---- 300 -----
C ---- ----- 150
D 550 ----- -----
Obviously in reality it's far more complex but that's the fundamental root of the problem.
I've debated a few ways and the best I've come up with so far is to TI run an ELCOMPN on A to get no. children, SubsetCreatebyMDX against the .Children to sort the data numerically and then run through a while loop using SUBNM against this new MDX created subset to load to each rank in order (whilst deleting generated sub each run and all the other normal malarky), etc.
Only problem is that it's a large, complicated cube it's pulling data from and a massive data set it's processing. It's not the fastest process in the world, even when dumping the data into a trimmed down staging post cube.
Any other simpler ideas? Been through the though process of IF/While/etc looping (yuk), Excel VBA based manipulation (double yuk) and a few even more ridiculous thought processes and best idea so far seems to be the MDX basis.
Anyone got any simpler / more efficient thoughts on this?
TIA