How can I create a dynamic column name in Cognos

1.Create a calculated column which contains the information that the header is to contain, such as "Report for year 1999" (concatenated text and date to string sub string extraction).
2.Highlight the report, and then right-click.
3.Select Properties, and then click the Headers/Footers tab.
4.Clear the Column Title Header check box. This will remove the headers from your columns.
5.Reinsert the rest of the column headers; insert text will work. For the dynamic column, from the Insert menu, click Data and select the calculated column you created and insert it into the report.

Editorial / Best Answer

Answered by: moissi

  • Nov 4th, 2007


1. add a data item to the query(the query on which the report is based)
2. define an expression which u want to use for the dynamic column label
3. from the report page click on the column label
4. from properties pane look for "column label" the default would be "data item label/name" change that to "data item value"
5. in the same pane change the "data item" property to have the data item that u created for the column label.

Showing Answers 1 - 38 of 38 Answers

Vishwas Gupta

  • Oct 17th, 2005
 

Hi,

As you said

.Select Properties, and then click the Headers/Footers tab.

I didnt find the option Headers/Footers tab.

Which version you are talking about ??

Thanks in advance

Vishwas

  Was this answer useful?  Yes

Rup

  • Nov 29th, 2005
 

use nested if/else or case structure in calculated columns or use conditional formating to show dynamically the column names

rkiranbedi

  • Apr 13th, 2007
 

Hi
Mr. Jagan
We can create Dynamic columns in both level like frame work manager level and Report level also

Using Macros we can create in Frame Work Manager Level
Using QueryCalculations we can create in Report Level
ok

mgani

  • Aug 22nd, 2007
 

We can create dynamic columns in two ways
1. by changing sql query
2. using macromacro use the perameter map to create column dynamically

  Was this answer useful?  Yes

JOYDEEP MUKHERJEE

  • Oct 15th, 2007
 

For making a column dynamic you have to insert layout calculations from the objects pane in COGNOS 8 report studio. I was a bit confused with the previous answers from different ppl.

  Was this answer useful?  Yes

moissi

  • Nov 3rd, 2007
 

1. add a data item to the query(the query on which the report is based)
2. define an expression which u want to use for the dynamic column label
3. from the report page click on the column label
4. from properties pane look for "column label" the default would be "data item label/name" change that to "data item value"
5. in the same pane change the "data item" property to have the data item that u created for the column label.

binay.bk

  • Jan 23rd, 2008
 

Hi Dear

Dynamic column is same as Hiding of a column.

Select the required column in your report.
Go to it's property.
Set the Box Type as "None"

Then you can see that the selected column is hidden.
 

  Was this answer useful?  Yes

reddy_143

  • May 13th, 2008
 

Create dataitem by using cast function and use that data item value for the dynamic column name by changing the source value (name under properties) for the column you need.

  Was this answer useful?  Yes

ps77322

  • Apr 17th, 2009
 

The requirement was some thing like, the heading's of a list report is
supposed to be dynamic. Column Name should be in the format as shown: Total
Budget XXXX, where XXXX represents year like next year or previous year etc. (ie.
XXXX can be 2009,2008..)


1. Add a data item to the query (the query on which the report is based)
2. Define an expression which u want to use for the dynamic column name
3. Go to the report page and then unlock the lock at the top menu.
3. On report page, click on the Source Type and change that to the data item
value
5. In the same pane change the Data Item Label property to have the data item
that was created for the column label.


Expression that i used was: (to get next year)
TO_CHAR(_add_years(TO_DATE(TO_CHAR({SYSDATE},'YYYY'),'YYYY'),1),'YYYY')


Hope that was helpful !!

You can use the following steps to have a dynamic column title

1. Click the unlock button and unlock the report design
2. Delete the column title
3. Place a text item on the column
4. Go to the query explorer
5. Drag a data item into the query
6. write the expression that you want for dynamic change in the column name
7. Open the report page
8. select the previously placed texr item and from the properties menu change the source to data item value
9. Select the data item that you just created

Should work fine with this

Cheers !!

  Was this answer useful?  Yes

Sandip Jaiswal

  • Jul 12th, 2011
 

Simply,
Add the query calculation or data item(i.e Current_Date) to the main query which you are using for your List or cross tab.
For example add to_char({sysdate},'MM/DD/YYYY') .
Click unlock and then insert the data item or query calculation you created earlier.
That's all, your data item will always have current date in your column header, similarly you can drag any data item from your main query to List Header

  Was this answer useful?  Yes

Shankar Satchit

  • Sep 2nd, 2011
 

Drag and drop a calculation layout next to the right side of the header text title and connect your prompt (with a bar sapce left on the right side of the text heading) i.e year "1999". It will read as
"Report for year 1999"
Dynamic header title.

  Was this answer useful?  Yes

Joseph Thekkath

  • Jan 16th, 2012
 

Mgani,

How we can create the column headers dynamically using parameter maps. Here is what I am facing, in the data table we have following columns

Id, Fact Period

And in a Translation Table I have row says

Fact Period Name , Fact Period Value
----------------------------------------------------
Fact Period , Q1 2012

How I can use parameter map here. Pls help thanks.

  Was this answer useful?  Yes

srihari

  • Apr 6th, 2013
 

Two ways to used in dynamic columns in Report Studio

1.Query Calculation
2.DataItem

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions