0% found this document useful (0 votes)
161 views9 pages

BI-Restrict Tree Prompt Selection With JavaScript

BI-Restrict Tree Prompt Selection With JavaScript

Uploaded by

sygladiator
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views9 pages

BI-Restrict Tree Prompt Selection With JavaScript

BI-Restrict Tree Prompt Selection With JavaScript

Uploaded by

sygladiator
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript

Nature of Document: Tip or Technique Product(s): IBM Cognos BI Report Studio Area of Interest: Report Design

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript Copyright and Trademar s Licensed Materials - Property of IBM. Copyright IBM Corp. 2010

IBM, the IBM logo, and Cognos are trademar s or registered trademar s of International B!siness Machines Corp., registered in many "!risdictions #orld#ide. $ther prod!ct and ser%ice names might &e trademar s of IBM or other companies. ' c!rrent list of IBM trademar s is a%aila&le on the (e& at http)**###.i&m.com*legal*copytrade.shtml (hile e%ery attempt has &een made to ens!re that the information in this doc!ment is acc!rate and complete, some typographical errors or technical inacc!racies may e+ist. IBM does not accept responsi&ility for any ind of loss res!lting from the !se of information contained in this doc!ment. ,he information contained in this doc!ment is s!&"ect to change #itho!t notice. ,his doc!ment is maintained &y the Best Practices, Prod!ct and ,echnology team. -o! can send comments, s!ggestions, and additions to cscogpp.ca.i&m.com.

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript

Ta!le o" Contents


1 Introduction..................................................................................................................4
1.1 1.2 1.3 1.4 Purpose........................................................................................................................ 4 Applicability.................................................................................................................. 4 Assumptions................................................................................................................. 4 !clusions and !ceptions.............................................................................................. 4

2 "#er#ie$...................................................................................................................... 4 3 %estrict &ree Prompt 'election $it( )a#a'cript ('tep*by*'tep Instructions)....................... +

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript

Introduction
! Purpose
&(is document describes a tec(ni,ue for report de#elopers t(at $is( to utili-e a &ree Prompt but re,uire t(at t(e #alue submitted be restricted to a desi.nated le#el $it(in a (ierarc(y.

!" #pplica$ilit%
&(is tec(ni,ue applies to I/0 1o.nos 2.3 'P334 2.44 2.4.14 and 15.1 usin. t(e 6reat "utdoor 'ales (cube) sample s(ipped $it( t(e product.

!& #ssumptions
&(is document assumes e!perience de#elopin. dimensional reports in I/0 1o.nos %eport 'tudio.

!' ()clusions and ()ceptions


&(is tec(ni,ue applies to sin.le*select tree prompts only. &(is tec(ni,ue re,uires t(e use of undocumented and unsupported capabilities in I/0 1o.nos /I. &(ere may be a ris7 associated $it( t(is tec(ni,ue in t(at support for t(ese capabilities may c(an.e or be dropped entirely in some future release. &(is tec(ni,ue $as created as a proof of concept and does not co#er all usa.e scenarios. &(is tec(ni,ue s(ould be t(orou.(ly tested before bein. used on a li#e I/0 1o.nos /I system.

" *verview
&ree Prompts are used in dimensional reportin. and allo$ t(e user to submit a #alue from any displayed le#el $it(in a dimension8s (ierarc(y. It is an easy to use .rap(ical interface t(at allo$s users to ,uic7ly .et to t(e #alue or #alues t(ey are concerned $it( $(en filterin. t(eir reports. &(e alternati#e to tree prompts $ould be a series of cascadin. #alue prompts4 $(ic( may not be as desirable as t(e use of a sin.le &ree Prompt. In some cases4 a tree prompt may be desirable for a #alue selection4 but only one of t(e le#els is re,uired to filter t(e report. 9or e!ample4 a report (as a filter on t(e mont( le#el. A tree prompt can be used to allo$ t(e user to ,uic7ly na#i.ate t(rou.( t(e years and ,uarters to .et to t(e desired mont(. In t(ese cases4 t(e report de#eloper may $ant to restrict t(e #alue submitted t(rou.( a &ree Prompt to a specific le#el in t(e dimension8s (ierarc(y. In t(is case4 t(e 0ont( le#el.

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript

& Restrict Tree Prompt Selection with JavaScript +Step-$%-Step Instructions,


&(e follo$in. $ill s(o$ an e!ample of implementin. a tree prompt t(at uses )a#a'cript to restrict a member selection at t(e mont( le#el of t(e :ears dimension. &(e report in t(is e!ample is a simple crosstab report $it( %e#enue as t(e measure4 Product lines on t(e ro$s4 and a ,uery calculation called 0ont( on t(e columns t(at prompts for a specific mont( from t(e :ears (ierarc(y of t(e :ears dimension.

&(e 0ont( calculation (as t(e follo$in. e!pression.


[great_outdoors_sales_en].[Years].[Years].[Month]->?Month?

&o en(ance t(is report $it( a tree prompt t(at restricts user selection to t(e 0ont( le#el4 use t(e follo$in. steps. 1. Add a prompt pa.e to t(e report. 2. Add a &ree Prompt to t(e prompt pa.e. 3. In t(e Prompt ;i-ard dialo.4 select <se e!istin. parameter4 and t(en select 0ont( from t(e drop do$n list.

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript

4. 1lic7 Ne!t4 clic7 t(e ellipsis (...) beside =alues to use4 and t(en select t(e :ears (ierarc(y under t(e :ears dimension. &(is allo$s t(e &ree prompt to display all members of t(e (ierarc(y.

+. 1lic7 ">4 and t(en clic7 9inis(. ?. 'elect t(e &ree prompt on t(e prompt pa.e4 and t(en in t(e Properties pane4 in t(e Name property under 0iscellaneous4 enter 0y&reePrompt. &(is name $ill be referenced in t(e )a#a'cript code you $ill use in an upcomin. step. @. Add an A&0B Item to prompt pa.e.

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript


2. Double*clic7 t(e A&0B item and add t(e follo$in. code to it.
<script> function getSelectedTreeLevel ! " if #indo#.treeM$Tree%ro&pt! if selectedTree'ode*(null! " var selectedTree'ode ( #indo#.treeM$Tree%ro&pt.getLastSelected'ode !) " var selectedLevel ( #indo#.treeM$Tree%ro&pt.getLastSelected'ode !.getLevel !) if selectedLevel *( +! for selectedLevel

,,Set level nu&-er that should -e selected

" alert .Select a Month for this /eport.!) ,,alert #hen #rong level is selected 0else " pro&pt1utton2inish !) 0 0else " alert .You &ust &a3e a selection.!) 0 ,,alert if no ite& has -een selected 0else " alert .treeM$Tree%ro&pt is undefined.!) #ith that na&e has -een found 0 <,script> 0 ,,alert #hen no tree pro&pt

C. 1lic7 ">. 15. "n t(e prompt pa.e4 delete t(e e!istin. 9inis( button and in its place add anot(er A&0B item.

11. Double*clic7 t(e A&0B item and add t(e follo$in. code.
<input t$pe(.-utton. class(.-p. value(.2inish. on4lic3(.getSelectedTreeLevel !.,>

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript


12. %un t(e report4 and t(en clic7 t(e 9inis( button.

Business Analytics

IBM Cognos BI - Restrict Tree Prompt Selection with JavaScript


13. 1lic7 ">4 select a member from t(e Duarter le#el4 and t(en clic7 9inis(.

14. 1lic7 ">4 select a member from t(e 0ont( le#el4 and t(en clic7 9inis(.

&(e report runs and filters t(e report based on t(e tree prompt selection.

Business Analytics

You might also like