Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]How can I convert month, year (Apr, 17) to 04/17?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]How can I convert month, year (Apr, 17) to 04/17?
 Login/Join
 
Silver Member
posted
I have looked through every possible date function and can't figure this one out. I have an input value of Month Name, Year (IE: Apr, 17). I need to convert that to a date (either 04/17 or even 04/01/17) so I can compare it against a date field. Any ideas?

TIA!

This message has been edited. Last edited by: MelissaReed,


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Member
posted Hide Post
Hi,

Guess it might help you... Not sure which format you are getting.. If you let me know the format as well then i can give you the exact coding.

Hope this works for you.
TABLE FILE CAR
PRINT
COMPUTE
Date/HYYMD = DT(2009 APR 01) ;
Date1/HYYM = DT(2009 APR) ;
Date2/HMD = DT(APR 01) ;
Date3/HMY = DT(APR 17) ;
BY COUNTRY
END

This message has been edited. Last edited by: Balakrishnan Palanisamy,


WebFOCUS 7x and 8x
Windows, All Outputs
 
Posts: 8 | Location: Bangalore | Registered: June 12, 2012Report This Post
Platinum Member
posted Hide Post
Where/how are you getting this input value? if its from the HTML front end, theres a plethora of display/actual combos there. If it is coming from somewhere else or input manually? then you need to start with what the incoming format is.


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
 
Posts: 115 | Location: Brighton UK | Registered: February 19, 2005Report This Post
Virtuoso
posted Hide Post
Please provide us an example of what you're trying to accomplish. Input could mean many things and the answer depends on the context.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
Is "Apr, 17" the actual or display format of the field which you want to convert? Whether it's the actual or display format is critical to the solution.

You can find almost 1001 ways to work with dates in WebFOCUS in a book, from IBI, of the same name.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
quote:
Apr, 17


Its depend on your use case , but you can get an idea
-SET &DATE = 'Jan,17';
-SET &MONTHNAME=GETTOK(&DATE,&DATE.LENGTH,1,',',&DATE.LENGTH,'A&DATE.LENGTH');
-SET &MONTHYEAR = DECODE &MONTHNAME(Jan '01', Feb '02' Mar '03' Apr '04' May '05' Jun '06' Jul '07' Aug '08' Sep '09' Oct '10' Nov '11' Dec '12')|'/'|GETTOK(&DATE,&DATE.LENGTH,2,',',&DATE.LENGTH,'A&DATE.LENGTH');
-TYPE &MONTHYEAR


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report This Post
Silver Member
posted Hide Post
Thank you for the feedback so far. I have a chart (tickets per month/year) that has the x-axis in MtY format which I'm passing to a drilldown report. I'm having trouble with the drilldown using the value and am looking for a better way to modify the incoming value so that I can use it in my where clause for the drilldown. Is there something that will take MtY and change it back to a more useable format?


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Virtuoso
posted Hide Post
Assuming your drill down report has a WHERE fieldname EQ &VAR, what is the format of fieldname? If you run the drill down report on its own, you should get prompted for &VAR in the above WHERE test. What do you enter to get a successful answer? You have to make sure whatever you pass to &VAR is the format it expects.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
hmmm... I wonder would it work the actual field being in an usable format and the label you see being in the MtY... or then using a hidden field...


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
 
Posts: 115 | Location: Brighton UK | Registered: February 19, 2005Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by Hank W.:
hmmm... I wonder would it work the actual field being in an usable format and the label you see being in the MtY... or then using a hidden field...


I've actually done that too, but have run into all kinds of issues when I try using stacked bar charts or multiple series in a bar chart. I'm trying to have a consistent approach regardless of my style of chart (if that is possible).


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Silver Member
posted Hide Post
Making progress... I got my input value into 04/01/17 but now I need to transform that into a date value that I can use to compare against my submit date field. No matter which function I try, I end up getting a zero. Any ideas?


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Virtuoso
posted Hide Post
Hi Melissa

Please share your current code with us so we can provide proper guidance.

Thanks


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Silver Member
posted Hide Post
-SET &MONTHNAME=GETTOK(&MONTH_YEAR,&MONTH_YEAR.LENGTH,1,',',&MONTH_YEAR.LENGTH,'A3');
-SET &INPUTDATE = '20'|GETTOK(&MONTH_YEAR,&MONTH_YEAR.LENGTH,2,' ',&MONTH_YEAR.LENGTH,'A2')|'/'| DECODE &MONTHNAME(Jan '01', Feb '02' Mar '03' Apr '04' May '05' Jun '06' Jul '07' Aug '08' Sep '09' Oct '10' Nov '11' Dec '12')|'/01/';
-SET &BEGIN_DATE = HCNVRT(HDTTM('&INPUTDATE',8,'HMDYYS'),'(HMDYY)',10,'A10');
-SET &END_DATE = HCNVRT(HDTTM(DATEADD('&INPUTDATE', 'M', 1),8,'HMDYYS'),'(HMDYY)',10,'A10');

This is what I ended up using. It seems to be working pretty good. Thank you Chaudhary for the suggestions


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Platinum Member
posted Hide Post
quote:
This is what I ended up using. It seems to be working pretty good. Thank you Chaudhary for the suggestions

Smiler


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]How can I convert month, year (Apr, 17) to 04/17?

Copyright © 1996-2020 Information Builders