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

What are the types of studio present in Cognos?

0 Answers  


It is possible to test 2 query subjects at a time in CRN1.1 & C8 FWM?

0 Answers  


in reportnet how u burst the reports for every 5th day, 10 th day, 15 th day, 20 th day

2 Answers   IBM, iFlex, iGate,


Which one is better among Value and select & search prompts,in terms of performance?

2 Answers   L&T,


What are the advantages of shortcuts?

0 Answers  






What do you do to make a report result in showing 4 different regions in an xl sheet in individual sheets(like Region1-sheet1,Region2-Sheet2 soon)?

5 Answers   IBM,


how you create security to cubes ?????

4 Answers   iFlex, iGate,


what are ERP systems?

1 Answers  


What is stitched Query?

5 Answers  


how to hide a particular pages at time if you get blank pages

3 Answers   IBM,


can we create a chart without measure

3 Answers  


How to find out OLTP data OLAP data ? i.e 5 years data is OLTP or OLAP. please anybody help me...

2 Answers   HCL, IBM,


Categories