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 drill down and slicing and dicing whats the difference between them?

540


i was asked what are the caluclations done by you in your report? plz give reply

1699


What are all the components of Report Studio?

653


How can I test reports in cagonos?

546


I have a reports on cognos ep7series version3 with database SQl2000.Now i am migrating database SQL2000 to SQL2005.Then What happens to cognos reports and also there is reports cubes then how can i handle this problem please give me step by step solution b'coz i am new to cognos ep7series

1703






What is the diff between cognos 8.1 & cognos 8.2 & cognos 8.3? Measn whet are the enhancements are added in new versions(8.2& 8.3)?

3912


Can you explain model durability?

580


How can we Maintain the Cube Security by Category level and Dimension level ?

1949


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

2503


What are all the types of report?

561


what is a prompt value in report studio and variables ?

2159


can anybody explain me about sales project in cognos..wt is the requirement,how u get the requirement..explain me any one based on ur experience as a report developer..how much time u will take to complete one project,single person in a team have to do how many reports..in a real time how much time will take to complete reports ie..one single report.. (simple and complex report)and in real time ur project contains how many fact tables and dimension tables..how many query subjects and query items..wt functional area u worked on.. hope u vl respond as soon as possible ..my mail- id is ammu2india@gmail.com

1699


What do you mean by drill through report?

571


Explain what is the difference between native sql and cognos sql?

518


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

1941