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

How can create users and permissions in cognos?

0 Answers  


what are the errors faced while bursting the reports and how to solve those errors?

0 Answers   EDS,


difference between join and union in reportstudio?

2 Answers   IBM,


What is Merging, Segments and porting in Framwork Manager?

3 Answers   Nike,


how many facts&dimensions tables in project? it's very urgent.........

2 Answers  






describe the starschema grouping ?how can i add a new column for existing report ,when it is not present even in model & dataabase?

0 Answers  


Can you define folder?

0 Answers  


What is meant by alternate drill down with ex?

0 Answers  


How to hide/unhide the prompts which are not used by unauthorized users?

3 Answers  


What is the difference between set functions and filter function in dimensional data?

0 Answers  


What are all the types of indexes in Cognos?

0 Answers  


What are all the types of report?

0 Answers  


Categories