Cognos Forum 2008 - Advanced Prompting

  • View
    84

  • Download
    1

Embed Size (px)

Text of Cognos Forum 2008 - Advanced Prompting

Tip or Technique

IBM Cognos Forum 2008 Session 1259 Advanced PromptingProduct(s): IBM Cognos 8 BI Area of Interest: Reporting

Session 1259 Advanced Prompting

2

Copyright Copyright 2008 Cognos ULC (formerly Cognos Incorporated). Cognos ULC is an IBM Company. While every attempt has been made to ensure that the information in this document is accurate and complete, some typographical errors or technical inaccuracies may exist. Cognos does not accept responsibility for any kind of loss resulting from the use of information contained in this document. This document shows the publication date. The information contained in this document is subject to change without notice. Any improvements or changes to the information contained in this document will be documented in subsequent editions. This document contains proprietary information of Cognos. All rights are reserved. No part of this document may be copied, photocopied, reproduced, stored in a retrieval system, transmitted in any form or by any means, or translated into another language without the prior written consent of Cognos. Cognos and the Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated) in the United States and/or other countries. IBM and the IBM logo are trademarks of International Business Machines Corporation in the United States, or other countries, or both. All other names are trademarks or registered trademarks of their respective companies. Information about Cognos products can be found at www.cognos.com This document is maintained by the Best Practices, Product and Technology team. You can send comments, suggestions, and additions to BestPracticesProductandTechnology@cognos.com.

IBM Cognos Proprietary Information

Session 1259 Advanced Prompting

3

Contents1 2 2.1 2.2 2.3 3 3.1 3.2 4 4.1 4.1.1 4.2 4.3 5 5.1 5.2 5.3 5.4 5.4.1 5.5 6 INTRODUCTION ............................................................................................ 4 ENHANCEMENTS TO PROMPT CACHING....................................................... 5 DYNAMIC PROMPT CACHE REFRESH.............................................................................. 5 MULTILINGUAL CACHE .............................................................................................. 6 UNILINGUAL CACHE ................................................................................................. 8 REUSABLE TOOLBOX OBJECTS ..................................................................... 9 WORKSHOP: RE-USABLE HTML ITEM......................................................................... 12 WORKSHOP: REUSABLE PROMPT CONTROLS ................................................................. 18 CUSTOM PROMPT CONTROLS OVERVIEW .................................................. 23 CREATE THE CUSTOM PROMPT CONTROL ..................................................................... 24 Beer Glass Control............................................................................................. 24 PLACE THE CUSTOM PROMPT INTO THE PROMPT PAGE ..................................................... 25 SET THE PARAMETER VALUES ................................................................................... 26 WORKING WITH THE SAMPLES .................................................................. 27 SETTING UP THE SAMPLES ....................................................................................... 27 CUSTOM PROMPT BUTTONS ..................................................................................... 28 BEER GLASS ........................................................................................................ 32 DYNAMIC PICKLIST PROMPT ..................................................................................... 36 How does the Dynamic Picklist Prompt Work ....................................................... 39 TAB CONTROL PROMPT........................................................................................... 41 CONCLUSION .............................................................................................. 46

IBM Cognos Proprietary Information

Session 1259 Advanced Prompting

4

1 IntroductionIn this paper we will cover two topics: changes to prompting in IBM Cognos 8.4 and custom prompt controls. The changes to prompting in the IBM Cognos 8.4 release are designed to both extend the prompt cache feature and make the prompt cache easier to administer. The custom prompt controls are designed to teach you the principles of creating your own prompt controls and provide some useful example such as a tabbed prompt interface and an on demand pick list. The custom prompt controls have been tested with both IBM Cognos 8.3 and IBM Cognos 8.4. This paper was presented at the 2008 North America IBM Cognos Forum.

IBM Cognos Proprietary Information

Session 1259 Advanced Prompting

5

2 Enhancements to Prompt CachingIBM Cognos 8.4 adds two additional features to the existing prompt caching feature. The first makes administration of the caches much easier, the second provides enhanced multi-lingual user support. 2.1 Dynamic Prompt Cache Refresh IBM Cognos 8.3 introduced prompt caching which allows the prompt query values to be cached and reused. The cache refresh was controlled through the use of Jobs to run the report prompt queries to refresh the cache. Customer feedback indicated that while this feature went along way to providing better prompt performance by reusing query results, the use of jobs to administer the prompt cache refresh was an onerous task which increased the maintenance work required of an administrator. Therefore, the management of the prompt cache has been simplified for IBM Cognos 8.4. For upgrade compatibility, Jobs can still be used to maintain the prompt cache. However, a new option has now been added to the report properties Report Tab as so:

When this option is used, the prompt cache will be managed automatically by the system with no requirement for Jobs or other intervention. This option uses user report execution to drive the prompt cache refresh activity. When the report is executed, we determine if the cache is valid or expired based on the expiry period specified in the report properties. If the cache is fresh then no action is taken. If the cache is expired then the cached data is deleted and the prompt query is executed to create the new cache.

IBM Cognos Proprietary Information

Session 1259 Advanced Prompting

6

2.2

Multilingual Cache 1 The prompt cache is multilingual and the query used to populate the cache is driven by the users Content Locale 2 (the language used to run reports and view data). When the cache is refreshed using the dynamic refresh method, the content language of the current user is used to run the prompt query. Only when subsequent users with a different content language run the report will the cache for another language be created. When the prompt cache is expired, all languages are deleted at the same time. To see this in action consider the following scenario and events: A report is newly created with no prompt cache. The Dynamic Prompt Cache option is set with an expiry of 7 days. On the day the report is created, a French language user runs the report causing the French language prompt cache to be created. This sets the cache creation date. On day 2, two more French language users run the same report. As the French language prompt cache already exists, it is used for all users. On day 3, a German language user runs the report. As there is no German prompt cache, the prompt query is run and the German prompt cache is created. The French cache is not affected by this operation. On day 3, new French language users also run the report and use the French language cache created on day 1. On days 4 through 7, additional French and German users run the report, using their respective language prompt caches. On day 8, a German user runs the report. Since the expiration date was set by the French cache on day 1, the prompt cache is now older than the 7 day threshold. The prompt cache is deleted in all languages even though the German cache is only 4 days old. To satisfy the German report request, a new German language cache is now created.

1

Note that with the IBM Cognos 8.3 job based cache refresh, the prompt cache was created in all languages when the job was run. 2 Locale is a combination of language and region. For example EN-US is English language in the United States region. While it is possible to differentiate data by locale Tire in North America versus Tyre in the UK, most companies do not make such a differentiation and instead use only the language to differentiate data. The sample databases that come with IBM Cognos 8 are perfect examples of this approach.

IBM Cognos Proprietary Information

Session 1259 Advanced Prompting

7

No other users run the report for 6 months. The cache is unaffected as there is no user operation to drive the refresh. An English language user runs the report. The cache (German) is past the expiration date so it is cleared and an English cache created. And so on, with language specific data being cached as required.

IBM Cognos Proprietary Information

Session 1259 Advanced Prompting

8

2.3

Unilingual Cache An interesting variation on multilingual applications has a multilingual users reporting against a unilingual database. That is, the users wish to see the data presented according to their content locale numbers and date in local format such as $123.45 versus 123,45$ or 1 January 2008 versus janvier 01, 2008 for example but the data is all in a single language. One IBM Cognos customer, a major airline, records all information in English but allows users to choose their language fo