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

Month extraction from Date

Started by LeeNash, 04 Apr 2013 03:57:39 AM

Previous topic - Next topic

LeeNash

Hi,

In Cognos Analyst I've been tasked with using an input field as a full date i.e. dd/mm/yy and then have another field which states the month only which looks at the full date.
Reason for this is the time dlist is a list of months i.e. Oct, Nov, Dec and we want to have the month which is pulled out to be dlist formatted. (Sorry if the terminology is incorrect here I've been working with Analyst for about a week now)

Ie. Full Date 01/10/13
     Month     OCT

I cant seem to find a way to take out the month as a value or dice up the full date and extract the month.

Does anyone know a good way of doing this?

Thanks

mr j

#1
Hi!

Not that I understand exactly why you want to do what you want to do   ;)    and since it was not your question let's leave that for now...

I quickly tested by creating a D-List of two items, hope you understand the syntax in the following:
- Item "Full date" with format "Date: DD/MM/YY"
- Item "Month" with format "Date: Mon YY" and calculation "= {Full date}"

The formats are what there's available in version 8.4.1, ie. no option "Mon" only, but it gets you pretty close. I know, unfortunately that's not always enough.

To get rid of the "YY" I used another format e.g. "DD-Mon-YY" and then D-Cube export to file. Then create a file map from this and create a subcolumn with the "Mon" part only to use as data, skip the other columns.

Now create your time D-List and in the import options select "Text file" and now comes the strange part... select the file you exported first. AFTER THIS you get the option to "Select how to interpret ASCII file" with options to use delimiter or a map. Choose "Use map" and then the map you created earlier.

There's possibly some better solutions, but this was the first that occurred to me right now and wanted to take part in this as there's possibly a need for something similar in the near future... I also edited this reply a couple of times so there's probably confusion in the minds of those who read the earlier ones   :D  Sorry folks..

LeeNash

ah ok so you've basically created a seperate dlist as a lookup then?
I think I understand

Thanks alot.

Lee

mr j

Well, that's what I ended up doing there, but I'm not quite sure if that's what you wanted   :)

Anyhow I guess the idea to extract the month from the date can be applied to whichever your purposes.