COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: dammora on 24 Jul 2006 11:13:23 AM

Title: Dynamic columns and calculations
Post by: dammora on 24 Jul 2006 11:13:23 AM
Hi All,

I need help with developing a report that uses prompt values to create a dynamic calculation.

Please see example below:

Column 1           Column 2                                 Column 3                                            Column 4
XYZ                  (currency based                  (currency based on 
                         on a prompt value)              on a prompt value)                          (column 2 - column 3

Column 2 and three would be have prompts associated to them for Year and Month.  When the user enters the date parameters, Column 4 should calculate the values accordingly. 

Any ideas? 

Thanks
Title: Re: Dynamic columns and calculations
Post by: krogovin on 21 Aug 2006 07:46:03 PM
Hi!

I think you can try to create columns 2, 3, and 4 as query calculations, using a case when statement.

For instance,

column2 = case when year = ?yr? then data item (ie revenue, qty, etc) else 0 end

column3 = case when month = ?month? then data item (ie revenue, qty, etc) else 0 end

column4 = column2 + column4

hopefully, that works..