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

cognos reportnet is molap or rolap ... somebady telling cognos reportnet is molap and other will be telling rolap ... i need extract answer

5 Answers  


9. What was the most complex type of report you dealt with?

0 Answers  


What is the function of cognos dispatcher?

0 Answers  


How do you Parametermap variables in Quiries?

0 Answers   TCS,


What is the size of the cube?

0 Answers  






Is there any comparison available for Cognos Reportnet Vs Crystal reports?

0 Answers   IBM,


advantages of cascade prompt ???

3 Answers   iFlex,


Can you define fan trap?

0 Answers  


Name the types of gateway?

0 Answers  


Does anybody have the sample of delivery document of cognos, or provide some link of websites Thanks

0 Answers  


Why Star Schema is de-normalized? Please explain in detail probably with some examples.

2 Answers   DELL,


What is called cognos reporting tool?

0 Answers  


Categories