If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

regarding dynamically adding columns

Started by subhash, 17 Jan 2008 03:40:13 AM

Previous topic - Next topic

subhash

hi,
  i have 2 prompts: From date and To date.

i will select from date as 01/01/2007 and To date as 01/01/2008. Now the difference between them is 12 months. so i have to get the 12 columns to be added to the report. if the difference is 15 then 15 cols are to be added to the report.

the sample is given below.

i have selected 01/01/2007(From date) and 01/04/2007 so the diff in months is 4. so my report should look like this

Sno  From Date  ToDate  Jan-07  Feb-07  March-07  April-07.
--------------------------------------------------------------
1  01/01/07  01/04/07    40         50         60          60


like this. this is my urgent requirement.

almeids

You have 2 choices I can think of:

(1) Use a crosstab
(2) If there's a maximum number of periods, you could create a list report with that many columns and conditionally suppress the ones you don't need.

Unless there are unusual/advanced formatting requirements you can't do with a crosstab, (1)would be the much simpler solution.

Suraj

I second using crosstab for this purpose.
The only thing you have to be aware is that if your months are just Jan, Feb etc...
then you may have Jan of 2006 overlapped with Jan of 2007. Therefore, your months need to be unique regardless of years.