COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Cognos_Jan2017 on 23 May 2017 10:30:23 AM

Title: _make_timpstamp from 2 Value Prompts
Post by: Cognos_Jan2017 on 23 May 2017 10:30:23 AM
Hopefully an easy answer.

No dates in the data.  Only Calendar and Fiscal Years, Fiscal Year Month #, and Month Names.

On Prompt Page, among other already working prompts, will require prompts to select
Calendar Year and Month Name (only one ... January, February, ... , December).

_make_timestamp requires Integers.  No problem from the Calendar Year prompt, and
hard-coding 1 as the day of the Month.

Keeping the 12 Month Names of the Year as Static Choices (don't want to have 1 thru 12 as choices).
How do I take the prompt result of the Month Name and convert that into an Integer?  Will try a
Case When to make a Query Calculation and place in the Query, and see if that might work.

Will continue a Google Search.  A search result said Cast won't convert alpha- characters into an Integer.

TIA, Bob
Title: Re: _make_timpstamp from 2 Value Prompts
Post by: New_Guy on 23 May 2017 10:42:05 AM
Hi,
Use value for Month prompt in the static choices as 1 ...12 and display as Jan...Dec and then convert. Hope this helps.
Good luck
New guy
Title: Re: _make_timpstamp from 2 Value Prompts
Post by: Cognos_Jan2017 on 23 May 2017 11:02:45 AM
WORKS !!!

Will be trying to write some other date functions, and continuing
to learn.

THANK you New guy, Bob