Prompt Macro Cognos

March 25, 2018 | Author: ignaciovlb | Category: Table (Database), Macro (Computer Science), Command Line Interface, Data Type, Databases


Comments



Description

®Prompt Macros in Framework and Report Studio Cognos 8 Rocky Mountain Cognos User Group November 5, 2010 Agenda ® • Overview of Prompt Macro Syntax • Business Case and Sample of Prompt Macro in Framework Manager • Business Cases and Sample Prompt Macro in Report Studio • In a Data Item • In a Filter Page 2 . • Prompt Macro – Syntax: prompt ( prompt_name .3 Documentation. text .Prompt Macro ® • Cognos 8. all other parameters are optional. 8. provides multi-select prompt Page 3 . defaultText . datatype . queryItem . 'integer'. Cognoise Article • Macro – a dynamic object which is used to substitute the values at query run time (encapsulated in ‘#’ signs) . trailing_text) Only the prompt_name is required. '10')# * promptmany macro – same syntax.3 FM User Guide. Sample: #prompt('StartingCountryCode'. • We looked for an approach that would have just one instance of the Time dimension in the package and prompt the user if they use the Time Dim and Fact table with which date they want to join on. each joined to fact table. This could lead to confusion and cluttering of the package. Time Dim – Effective Date Time Dim – Entry Date Time Dim – Order Date Fact Table Time Dim – Date Effective Date Fact Table ?Join Date? Effective Date Entry Date Entry Date Order Date Order Date Page 4 .Framework Manager Use Case ® • Transactions have 3 different dates associated with them. The report developer would like to have a Time dimension associated with all 3. • The Time dimension was very important because we have a large number of business-defined Time periods that we have flags for (Y/N values) that are updated each day based on last loaded business date. Could be modeled with 3 Query subjects. in a report schedule prompt.What the Solution Looks Like ® • When the user runs a report that includes the Time Dim and Fact table. or embedded in a prompt page and given a default value and hidden. Current Business Date • This can be answered at run time. they are prompted to select a date type (to join on). Page 5 . The lookup table and parameter map aren’t required.Framework Manager Prompt Macro Example ® • This technique involves three components: • Lookup (database) table with selection options. This must be available in the FM model. • Parameter map converts the user selected value from the prompt list to the data item name. Page 6 . but they make the technique more user friendly and foolproof. • Prompt macro in the join expression in model replaces regular join expression. a filter is added for the parm_type so only the relevant options are returned to the user. Page 7 .Lookup Table ® • The lookup table is used as the “queryItem” in the prompt macro. • Sample data from the report parameter table. Our table design has three different columns for datatypes number. text and date to support different possible prompt values. This provides the end user with the choices to select from. When this table is modelled in FM. Page 8 .Parameter Map ® • The parameter map takes the user selected value from the “queryItem” (key) and converts it to the appropriate data item (value) that will be used in the join. Standard Join Expression Click to modify join expression 2.Modifying the Join Expression (Building Blocks) ® 1. Join Expression with Prompt Macro (only) [Namespace].'token')# Prompt Name token Data Type – passes value with no single quotes .[TIME].[Effective Date] = #prompt('Please enter join option'. Final Join Expression Wrap a parameter map around the prompt macro [Namespace].[Effective Date] = #$TXNJoinDateOption{ prompt('Please enter join option'.'token'.Modifying the Join Expression (Building Blocks) ® 3. ''.[Please select a date type]')}# .[TIME].'token'.[Please select a date type]')# Optional – default value queryItem – lookup data item for prompt Optional – preceding text 4.''. ''.[REPORT_PARMS_TXN_Date_Types].[REPORT_PARMS_TXN_Date_Types].''.[Effective Date] = #prompt('Please enter join option'. Join Expression with Prompt Macro and Lookup Table (queryItem) [Namespace].[TIME].'[Namespace].'[Namespace]. MTD or YTD totals (for which there are 3 different columns of data with similar names).' Value]')# User Selects ‘MTD’ Preceding Text Trailing Text [Namespace]. '[Namespace].[Query Subject].'token'.[Query Subject].[Daily Value]'.['.'[Namespace].Report Studio Data Item Example ® • The report allows the user to select Daily.[Query Subject].''. The macro resolves the user selection to the appropriate data item name. The prompt uses a Value Prompt with Static Choices. #prompt('Date Type'.[MTD Value] . The macro resolves the user selection to the appropriate data item name in the filter expression. #prompt(‘Dealer Type'. The prompt uses a Value Prompt with Static Choices.'[Executing Firm Number])# = ?select dealer? User Selects ‘Clearing Dealer’ and ‘1234’ [Clearing Firm Number] = ‘1234’ .Report Studio Filter Example ® • The report allows the user to select a Firm type (for which there are 3 types).'token'. 3/ug_fm.ibm.com/community/index.cognoise.com Thanks for coming today! Additional Resources – http://download.php?action=printpage.topic=9015.wss?rs=3442&context=SS9RTN&dc=DA400&uid=swg27014543&loc=en_US&cs=UTF8&lang=en&rss=ct3442db2 http://www.com/ibmdl/pub/software/data/cognos/documentation/docs/en/cognos8_bi/8.pdf http://www01.ibm.boulder.Questions? ® Joe Allyn (303) 768-2670 [email protected]/support/docview.0 .
Copyright © 2024 DOKUMEN.SITE Inc.