GeekInterview.com
Series: Subject: Topic:
Question: 211 of 211

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.
Asked by: Interview Candidate | Asked on: Oct 9th, 2005

Editorial / Best Answer

Answered by: moissi

Answered On : 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.

Showing Answers 1 - 16 of 16 Answers
Vishwas Gupta

Answered On : 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

  
Login to rate this answer.
Rup

Answered On : Nov 29th, 2005

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

  
Login to rate this answer.
Mehul@DWH

Answered On : Feb 16th, 2006

View all answers by Mehul@DWH

Hi,

What do you exectly mena by Dynamic column, do you mean dynamicaly calculated column.

  
Login to rate this answer.
rkiranbedi

Answered On : Apr 13th, 2007

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

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

Yes  1 User has rated as useful.
  
Login to rate this answer.
mgani

Answered On : 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

  
Login to rate this answer.
JOYDEEP MUKHERJEE

Answered On : 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.

  
Login to rate this answer.
moissi

Answered On : 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.

Yes  5 Users have rated as useful.
  
Login to rate this answer.
binay.bk

Answered On : Jan 23rd, 2008

View all answers by binay.bk

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.
 

  
Login to rate this answer.
reddy_143

Answered On : May 13th, 2008

View all answers by reddy_143

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.

  
Login to rate this answer.
ps77322

Answered On : Apr 17th, 2009

View all answers by ps77322

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 !!

Yes  2 Users have rated as useful.
  
Login to rate this answer.
nilesh_tiwari

Answered On : May 28th, 2009

View all answers by nilesh_tiwari

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 !!

  
Login to rate this answer.

In all Cognos 8 Versions you can implement the above things

  
Login to rate this answer.
Sandip Jaiswal

Answered On : 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

  
Login to rate this answer.
Shankar Satchit

Answered On : 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.

  
Login to rate this answer.
Joseph Thekkath

Answered On : 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.

  
Login to rate this answer.
srihari

Answered On : Apr 6th, 2013

Two ways to used in dynamic columns in Report Studio

1.Query Calculation
2.DataItem

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.