Create 12 columns for months by writing single case statement?



Create 12 columns for months by writing single case statement? ..

Answer / naresh

To create 12 columns for months by single case statement :-

Step-1: Create one derived column and name it as 'months'.

Step-2:In Derived Expression use the below case statement and click on ok -

case
when extract(month,DATE_Column)=1 then 'JAN'
when extract(month,DATE_Column)=2 then 'FEB'
when extract(month,DATE_Column)=3 then 'MAR'
when extract(month,DATE_Column)=4 then 'APR'
when extract(month,DATE_Column)=5 then 'MAY'
when extract(month,DATE_Column)=6 then 'JUN'
when extract(month,DATE_Column)=7 then 'JUL'
when extract(month,DATE_Column)=8 then 'AUG'
when extract(month,DATE_Column)=9 then 'SEP'
when extract(month,DATE_Column)=10 then 'OCT'
when extract(month,DATE_Column)=11 then 'NOV'
when extract(month,DATE_Column)=12 then 'DEC'

end

Step-3: Click on derived Column 'Months' and go to 'Structure' tab in File Menu and then click and 'Pivot list to Cross tab '

Step-4: Run and check the report.
Thats it ..

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Cognos Interview Questions

Hi, I have Cognos 7.0 Impromptu reports and these reports have been created with the Mainframe datasource. Now the business needs these reports should be upgraded but with Oracle datasource. So what's the idea, first we should migrate these reports into ReportNet? then in that case what we will do with the Impromptu Catalog? Second, suppose we need to migrate these reports into Cognos 8 (may be 8.4) then how we will do that? do we need to create a FM Model for these reports. Please advice!

0 Answers   Wipro,


. how will we hide the “report title ” in pdf format, but title should be remain unchanged in html format.

3 Answers  


what is the difference between list sequel and cross tab sequel?

2 Answers  


How is possible this scenario using in type-in prompt.?

0 Answers  


write a query to display the third record from the employee table?

6 Answers   HCL,






What are the types of hierarchies?

0 Answers  


How to maintain Query subject’s relationships between Database layer and Model Layer? For eg - if 2 DB layer's query subjects are copied in Model Layer - Query subjects respectively, then Where should we define relationship of both Query subjects? Either in DB layer or Model layer?

0 Answers  


What is a business view? and what is the difference b/w business view and folder?in cognos report life cycle when it will be involved ?

1 Answers  


What is the use of report studio?

0 Answers  


If you need latest cognos certification dumps to get certified in first attempt with 100% score, please e-mail to getmecert@yahoo.com

4 Answers  


How to upgrade drivers in Cognos 8?

1 Answers  


What is Star schema group?

1 Answers   IBM,


Categories