Sunday, April 6, 2014

Many prompt queries make the report slow, how do I speed it up

    Having a lot of different prompts or having a prompt that displays a lot of entries can slow down the execution of a report. This document describes methods of improving this.

Resolving the problem

   The first, and easiest thing to do is to ensure that your prompts are retrieving their data from the smallest dataset possible. Thus, if the same data exists in two different (joined) tables, use the smaller table.

   Second, you can try to modify the prompt query to include a filter that will reduce the amount of data that the prompt has to go through.

   Third, try to make your prompts based on key data instead of text data by setting the use and display options of the prompt; so if you're prompting on
Customer, you want the prompt Use to be based on Customer #, not Customer Name.

    Fourth, make sure that the data you're prompting for is indexed. This is tied to the previous suggestion, because key data is automatically indexed in most database systems.

    Fifth, and the most difficult but potentially most effective solution is to join many of your prompt queries together. There are a couple of strategies that might be effective.


If you expand the query to include other fields you can set multiple prompts to use different parts of the same query. This could be effective if some of your prompts are exclusive of other prompts. Alternatively, you can set up cascading prompts. This allows you to use the selection of one prompt as a filter for another prompt. This is highly effective in cases where you are selecting increasingly restrictive fields 
(so if you were selecting a product, you'd show a product Line prompt, and then restrict the query for the product name based on the product line that was selected). This allows the queries to show less data, which allow them to run faster.

Customizing the welcome page in Cognos Connection

For hiding links the "Manage Cognos Content" link edit the following file.

In the : <install directory>/templates/ps/portal/welcome/welcome.xml file comment out or remove the following line.
<tool name="ManageCognosContent" type="cognos" />

An HTML comment is like so,
<!-- <tool name="ManageCognosContent" type="cognos" /> -->

Restart Cognos 8 service to see the change

Tools can be permanently hidden be removing the relevant tool tag from the welcome.xml file. If a tool is not present in the welcome.xml file, it will not show up as a link in the welcome page (even with the appropriate capabilities).

How to pass an empty string to a prompt macro

Use a space for the default value in prompt macro.

The prompt, which is created in FM using prompt macro, becomes required prompt. This means that we need to supply a value in order to satisfy this prompt.

If a space is added as a default value in prompt macro, the prompt is satisfied and the report runs.
Macro will look like this: # prompt('Desk' , 'string' , ' ')#

Please note that there is space between " ".

Also, in the SDK a space needs to be used as a value to satisfy the required prompt.

For example: item.setUse(" ");

The space does not get passed to the stored procedure and the report runs successfully.

How to use _round up and down in Report Studio

1) round:

for _round, _round(0.0283,3)=0.028
_round(0.0283,2)=0.03
_round(0.0283,1)=0


2) round up:

use ceiling(numeric_exp),returns the smallest integer greater than or equal to numeric_exp.


ceiling(0.0283*1000)/1000=0.029
ceiling(0.0283*100)/100=0.03
ceiling(0.0283*10)/10=0



3) round down:

use floor(numeric_exp), returns the largest integer less than or equal to numeric_exp.


floor(0.0283*1000)/1000=0.028
floor(0.0283*100)/100=0.02
floor(0.0283*10)/10=0

How to: Display the bottom 10 in a Cognos 8 Report Studio report

Use a rank() calculation on a calculated sort key column and then filter on the rank calculation. See attached GO Sales sample report spec.


Steps:

   Create a new List Report:


   1) Add Product Name, Product Line and Revenue
   2) Add a Detail Calculation = Revenue * -1 (to get the inverse ranking)
   3) Add a Detail Calculation = rank() on the calculation above
   4) Add a filter = rank <= "bottom" (a parameter to enter the number for bottom)

How to do page breaks in Cognos 8 Report Studio

Steps:

1.  Created a new List Report with grouped query items.
2.  Go to Report Pages.
3.  Add a Page Set.
4.  Set the Page Set Query property to the list query.
5.  Open the Page Set Grouping & Sorting property.
6.  Add the grouped Query item to the Grouping folder in the left pane and click OK.
7.  Back in Report Pages, drag the original page (default Page1) to the Page Set Details folder.

8.  Run the report.

How to burst in Cognos 8 without a Burst Table


       This document will describe how to set up a report for bursting via email that does not require a burst table. This is the Cognos 8 equivalent of the bursting demo that was included in the Report Authoring Part 2 book for CRN. 

        Requires Argosoft mail server with an account for Alessandra Torta (
atorta@grtd123.com), Notification configured in Cognos Configuration, Outlook Express with an account set up for Alessandra Torta (atorta@grtd123.com).


Resolving the problem


        Basically, you create a calculation that holds the names of the people to which you want to burst reports. This requires that their names exist in the data source in such a way that you can create an email address from the first and last name fields.

The calculation would then be used as the burst key.