ODBC Drill Through on any Level of Element
Posted: Wed Aug 24, 2011 7:05 am
Hi
I searched the forum and came across various posts relating to this subject but none of them actually gave a clear solution.
So, we have a sales cube that has three dimensions, Division, Year and Month.
Division has the following elements in it.
Total Company
->Total Chemical Division
->Consumer Market
->Animal Feeds
->Bulk Products
->Total Mining Division
->South Africa
->Botswana
->Namibia
Now, we are able to drill through to the ODBC sales transactions only if we are on level zero for all three dimensions.
We also managed to convert the alias back to dimension name in the prolog by doing this.
And in the ODBC Query we got something like.
So the place where we got stuck was, if we try to drill on the sales value for "Total Mining Division" we don't get any records returned from the ODBC as "Total Mining Division" does not exists as a value in the fact_sales_invoices table.
So we tried changing the variable vDivision in the prolog to.
But we still get no result. So the question that I have is actually two fold.
1. How can I see what values are assigned to vDivision at run-time? This would allow us to model the variable to get the right string to pass to the ODBC where statement.
2. How do I populate vDivision in the example above, so that it is set to 'South Africa','Botswana','Namibia'?
I searched the forum and came across various posts relating to this subject but none of them actually gave a clear solution.
So, we have a sales cube that has three dimensions, Division, Year and Month.
Division has the following elements in it.
Total Company
->Total Chemical Division
->Consumer Market
->Animal Feeds
->Bulk Products
->Total Mining Division
->South Africa
->Botswana
->Namibia
Now, we are able to drill through to the ODBC sales transactions only if we are on level zero for all three dimensions.
We also managed to convert the alias back to dimension name in the prolog by doing this.
Code: Select all
vDivision=DimensionElementPrincipalName('Division',Division);
vMonth=DimensionElementPrincipalName('Month',Month);
vYear=DimensionElementPrincipalName('Year',Year);
Code: Select all
Select
entity_code,
entity_name,
cal_month,
cal_year,
customer,
invoice_number,
invoice_amount
from fact_sales_invoices
where entity_code in ('?vDivision?')
and cal_month = '?vMonth?'
and cal_year = '?vYear?'
So we tried changing the variable vDivision in the prolog to.
Code: Select all
vDivision= '{TM1DRILLDOWNMEMBER( {Division}, ALL, RECURSIVE )}' ;
1. How can I see what values are assigned to vDivision at run-time? This would allow us to model the variable to get the right string to pass to the ODBC where statement.
2. How do I populate vDivision in the example above, so that it is set to 'South Africa','Botswana','Namibia'?