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>

Working with dates in Cognos

In Cognos reports I use various dates. I use today, first day of this year, first day of last year and last day of last year.First and last day of last year is used in january. In february we switch to the current year.

I use the following expressions to fill these dates:

Today: current_date

First day of this year: _add_days(Current_date ; (_day_of_year(Current_date)*-1)+1 )

First day of last year (only used in january): _first_of_month(_add_years(current_date;-1))

Last day of last year (only used in january): _last_of_month(_add_months (current_date;-1))