Page 1 of 1

Dimension order in a source view used as datasource in TI

Posted: Thu Nov 26, 2020 12:11 pm
by ottaviopf
Hi All,
apologize me if I'm posting something already discussed, but I was not able to find an existing discussion in this forum in past days and, today, the search functionality in this forum is not working to do additional research.

My problem is: I need to "receive" in TI Data tab the data extracted from sourceview created in Prolog with a specific order. Imaging a cube with 3 simple dimension Product, Customer, Measure and I need to receive the data in this way

Code: Select all

 PROD A - CUST 1 - QUANTITY - 100
 PROD A - CUST 1 - SALES - 1000
 PROD A - CUST 2 - QUANTITY - 200
 PROD A - CUST 2 - SALES - 2000
 PROD B - CUST 1 - QUANTITY - 300
 PROD B - CUST 1 - SALES - 3000
 PROD B - CUST 2 - QUANTITY - 400
 PROD B - CUST 2 - SALES - 4000
  
Practically I need to "receive" in sequence in Data tab the combination of Customer/Measure for one Product and after the Customer/Measure combination for Product B and so on.
I understood that there are 3 variables that can influence the way the source data arrive in Data tab
1) Phisical order of the dimension in the source cube
2) Optimized storage order of the dimension in the source cube
3) TI funcion ViewRowDimensionSet

Can someone help me to understand the sequence of priority of these variables? Or someone has a different approach to obtain the expected results?
Unfortunately, also with some tests, I was not able to arrive to a definitive sentence.

Thank you in advance
Ottavio

Re: Dimension order in a source view used as datasource in TI

Posted: Thu Nov 26, 2020 1:22 pm
by Steve Rowe
Hi,

In a view being used as a datasource for a TI there is only one thing that controls the dimension order.

After creating the view in the TI using ViewCreate this will be the natural dimension order of the cube.

When a view is being processed by a TI all dimensions are considered to be on the rows. The TI functions for setting the dimension positions are for building user facing views if you try and use them for a datasource view then you'll get odd results, it's not worth the effort.

The real question here is why do want to control the order? It's an unusual request.

I suspect you want to control the order of the view so that the measures follow in a regular manner, i.e. the sales for an intersection follows the quantity.

The "most right" way of doing this is to just have the quantity in your view and then read the value for the sales from the cube using CellGetN, this way the order of the view is not relevant.

If you explain why you need to control the order then perhaps we can suggest an alternative approach.
Cheers,