Create 12 columns for months by writing single case statement?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

what is model and say about process how to create model and how to test model?

738


-----------Diff b/w OLAP and RDBMS?

1796


What are the different uses of a repository manager?

745


--------------Explain Table of contents?

1715


2. What functional area you worked on.

2055






What is the difference between Open Connection command ang Open Session Command?

2076


Name the types of report?

697


what is the diff. between a link n a union? what is a custom view? what is the use of unlocking a report ? plz answer to these

1747


What is the difference between Standard and Metrics folder?

728


explain how to create powerplay reports?

742


What is difference between page break and section report? What is main advantage datawarehousing over oracle?

762


Explain the characteristics of cognos?

741


How to limit the cut,copy and paste operations for an user in reportlevel? Can anyone please send me the steps as i am new to cognos?

2306


What are the batches and it’s details?

700


hi this is bhaskar iam working in Tcs u want any real time faqs send me your qs i will ans that qs ok this is my id bhaskarparitala.rao@gmail.com

1764