Cognos Report Studio allows you to define drill-through. However, there is no facility to define conditional drill-through. This recipe will show you how to achieve it.
We will use the report created in the previous recipe for this. We will create drill through from the crosstab intersection to a dummy report (drill 1). Then we will try to achieve a conditional drill-through to another report (drill 2) for certain months.
Create two dummy reports called Drill 1 and Drill 2.
Open the report created in previous recipe in Cognos Report Studio.
Is_2004
. Define the condition as: [Query1].[Current Month] contains '2004'
Is_2004
as Style Variable to both the drill links.Is_2004
is Yes and same for the right link when Is_2004
is No. That is, turn the visibility off for one of the links, depending on the condition.
Within the drill-through definitions dialog box, there is no reference to the conditional variables. So, Report Studio provides no direct way to switch the drill target depending on a condition.
As a solution, we are creating a copy of the text item here and then we hide one of them based on a condition. As the text items go to different targets, we achieve conditional drill-through in the report.