Dynamic current month selection

I found some interesting knowlegde on getting the current month dynamicly as a filter in Cognos. Here are the steps how:

Expand your time dimension and select any month member (Members are the one with the blue rectangle icon).

Right click on the member and select Properties, and you will see there a property called Member Unique Name. This is usually structured like this: [cube].[dimension].[hierarchy].[level]->:[PC].[@MEMBER].[Name]

Once you have that, copy it. Look at the structure – we’re interested in the last bit – how is a month MUN constructed.
For our example, we’ll suppose it is built like this:[Sales].[Time].[Time].[Month]->[Time].[2010].[201003] (That’s March 2010, yyyymm).
So, you create a data item like this:
#'[Sales].[Time].[Time].[Month]->[Time].[‘+ timestampMask($current_timestamp,’yyyy’)+’].[‘+timestampMask($current_timestamp,’yyyy’)+timestampMask($current_timestamp,’mm’)+’]’#

Which will dynamically translate (Today) to [Sales].[Time].[Time].[Month]->[Time].[2014].[201402]

Item was written by Nimrod Avissar on Cognoise.com

Displaying different colors for alternate rows

Follow the next steps:

1. Add a query calculation containing a running-count summary eg running-count([Order_no])
2. Add a second query calculation as follows: mod([First calc],2)
3. Set up a boolean variable in the condition explorer with the expression [Second calc] > 0
4. Select ‘list columns body style’ using the Select Ancestor button, select the Style Variable property, and pick your boolean variable.
5. Hover your mouse over the Condition Explorer, select the ‘Yes’ variable value, then set the Background Colour property.  Using the condition explorer, switch to the ‘No’ variable value and repeat using a different colour.
6. If your calculations exist in the query but are not shown in the list, select the list using the Select Ancestor button, go to the Properties property, and enable the calculations as properties of the list.

Source: http://www.cognoise.com/index.php/topic,2973.0.html

Information pop-up in Cognos report

A customer wants some information in the report about filters and conditions.

One way to create this is with some html:

<html>
<head>
<script type=”text/javascript”>
<!–
function Info() {
alert(“<PUT YOUR OWN TEXT /INFORMATION HERE>”);
}
//–>
</script>
</head>
<body>
<!–<p>Can be used to add text before the button:</p>–>
<form>
<input type=”button” value=”REPORT INFORMATION” onclick=”Info();” />
</form>
</body>
</html>