TI parameter from Drill Rule

Post Reply
iansdigby
Community Contributor
Posts: 109
Joined: Thu Feb 26, 2009 8:44 am
OLAP Product: TM1
Version: 9 + 10 + Plan An
Excel Version: All
Location: Isle of Wight, UK

TI parameter from Drill Rule

Post by iansdigby »

I am wondering if it is possible to pass a parameter to a TI process, from within a Drill rule assigment. Depending on which dimension hierarchical levels are showing when a user right-clicks and selects "Drill", the resulting drill-down list should be filtered accordingly.

The Drill Process Data Source SQL string is a simple "SELECT * FROM " and I want the TI script to filter the result based on the Dimension level/s parameter/s passed from the Drill Rule. Much gratitude to anyone who will kindly help with this. Ian Digby
"the earth is but one country, and mankind its citizens" - Baha'u'llah
User avatar
Steve Rowe
Site Admin
Posts: 2415
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: TI parameter from Drill Rule

Post by Steve Rowe »

Hi Ian,

When you set up the drill TI process the view is displayed in the data tab and all the variables associated with the source view are in the variables tab. You can use these variables to modify the SQL at run time.

http://forums.olapforums.com/viewtopic.php?f=3&t=722
and
http://forums.olapforums.com/viewtopic.php?f=3&t=773

both give some detail on how to get your SQL query modified at runtime.

HTH
Technical Director
www.infocat.co.uk
iansdigby
Community Contributor
Posts: 109
Joined: Thu Feb 26, 2009 8:44 am
OLAP Product: TM1
Version: 9 + 10 + Plan An
Excel Version: All
Location: Isle of Wight, UK

Re: TI parameter from Drill Rule

Post by iansdigby »

Steve,

Just to express my appreciation for this valuable help. In the end I couldn't create a new parameter within a drill process but another post on here describes how to 'hijack' a default parameter. The measures dimension doesn't need to be parameterised but it is , so you can use that one. I used it to represent stocked Items.

My problem was to edit a section of the Source SQL according to what level of "Item" the user was drilling from.
Level 0 Items have no prefix,
Level 1 are prefixed with "NR-Grp",
Level 2 with "NR-Cat".

So here's the code I used in the Prolog tab:

IF (SUBST(Stock_Item, 1, 3)@<>'NR-');
ReliabilityMeasure='Item';
ELSEIF (SUBST(Stock_Item, 1, 6)@='NR-Grp');
ReliabilityMeasure='''NR-''' | '+ImastGrp';
ELSEIF (SUBST(Stock_Item, 1, 6)@='NR-Cat');
ReliabilityMeasure='''NR-''' | '+ImastCat';
ENDIF;

Then I plugged the ReliabilityMeasure into the Data Source SQl as follows:

SELECT * FROM Table1 WHERE ?ReliabilityMeasure?='?Stock_Item?'

It worked a charm except parsing the single quotes within a string can be challenging.

Again, thanks very much for your help

Ian
"the earth is but one country, and mankind its citizens" - Baha'u'llah
User avatar
Steve Rowe
Site Admin
Posts: 2415
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: TI parameter from Drill Rule

Post by Steve Rowe »

Thanks for posting your comments and solution Ian, always helps to enrich the forum when people post their solutions as well as their questions! :D
Technical Director
www.infocat.co.uk
Post Reply