If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Extract Month as Text instead of Integer?

Started by KEKeogh, 12 Jun 2009 11:46:37 AM

Previous topic - Next topic

KEKeogh

I have the following formula: Extract(Month,[DSR].[VIEW_APPLN_AVAIL].[CDATE])

What I want to do is instead of getting an integer as a result, I want to get the name of the month.

Is there a way to do this either within the formula or after the fact with formatting? 

Thanks
Kathie

CognosPaul

What database are you using? There are many different functions for this, depending on the db in question.

On what level is your query grouped? If you're, for example, showing all sales on a month, then you need this done on the query level, if you're showing details of every sale, leave the date as it is and set Data Format --> Format Type: Date --> Display Months: No, Display Days: No, Display Months Long Name. If you are grouping by month, use something like: _first_of_month([DSR].[VIEW_APPLN_AVAIL].[CDATE]) then set the formatting as above.

Alternatively you can do this on the framework level, or ideally on the database level. Do you have a time dimension table?

kalyan_y

If u hav "vendor specific functions" available, then u can use monthname(<dateexp>) in the expression definition box, and set the "Query Processing" property of the Query to Local

KEKeogh

Thanks!  I got it to work using the monthname function.

It was the simplest solution.