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] InfoAssist Conversion from non-standard A10 to HYYMDs/efficiencies

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] InfoAssist Conversion from non-standard A10 to HYYMDs/efficiencies
 Login/Join
 
Silver Member
posted
Please forgive the low skill level I'm sure to exhibit here.

I'm trying to convert an A10 field to HYYMDs format. Unfortunately, the A10 field is in the Day/Month/Year format, while it seems HINPUT is expecting Month/Day/Year formatting. This throws HINPUT for a loop, as it doesn't know how to react (I haven't told it how to react, more accurately) when it gets any value >12 when it's expecting a Month.

So, I embarked on the journey of pulling the different digits out of the original A10, reversing them, and concatenating them.

This involved an 8 step process, in 8 different Defined fields.

Pull out the Month
Pull out the Day
Pull out the Year
Concatenate the Month and a '/'
Concatenate the Day and a '/'\
Concatenate the new Month and Day fields
Concatenate the new Month/Day/ with Year
HINPUT on the newly created A10 date field

I KNOW there is an easier way to do this.

1) Is there a way to declare and use temporary variables within the body of a defined field so I can combine some of these steps?
2) Is there a way to concatenate more than two fields at a time? The only function that I saw (CONCAT) only allowed two arguments to be concatenated in each step.
3) Is there a way to tell HINPUT to reverse it's normal expectation of Month/Date?

While you may be able to solve the problem for me by answering number three alone, I think the answers to questions one and two would be helpful as I'm still trying to learn the basics here, obviously.

P.S. I realize my solution above is laughable! That's why I'm here, this can't possibly be the best way to solve this problem, even if it gets the job done.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2.0.1 / App Studio 8.2.0.1 (04092014) / Windows 7 / HTML5, PDF, XLS
 
Posts: 40 | Location: Kansas City, MO | Registered: June 10, 2013Report This Post
Expert
posted Hide Post
Here is an example of how turn an alpha column into a Date-Time column. It requires two steps - one to convert the alpha column to a DATE column, one to convert the DATE column to a DATE-TIME column.

DEFINE FILE CAR
DATE1/A10 = '21/09/2016';
END

TABLE FILE CAR
PRINT
DATE1

COMPUTE DATE1A/YYMD = DATECVT(EDIT(DATE1,'99$99$9999'), 'A8DMYY', 'YYMD');
COMPUTE DATE1B/HYYMDS = HDTTM(DATE1A, 8, 'HYYMDS');

BY COUNTRY
END


Yes, it seems strange that HINPUT cannot use MMDDYYYY input...

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
You can do it one step, though it would be very difficult to read:

DEFINE FILE CAR
DATE1/A10 = '09/21/2016';
END

TABLE FILE CAR
PRINT
DATE1

COMPUTE DATE1B/HYYMDS = HDTTM( DATECVT( EDIT(DATE1,'99$99$9999'), 'A8MDYY', 'YYMD' ), 8, 'HYYMDS' );

BY COUNTRY
END

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
quote:
...the A10 field is in the Day/Month/Year format, while it seems HINPUT is expecting Month/Day/Year formatting...

To change this expectation, it looks like you can change the setting of DATEFORMAT from MDY (US English default) to DMY.

For example:
SET DATEFORMAT = DMY
SET ONLINE-FMT = STANDARD
DEFINE FILE CAR
 CN_DATE/A10 WITH COUNTRY = '28/03/2017';
 DTETME_FROM_ALPHA/HYYMDS = HINPUT(10, CN_DATE, 8, 'HYYMDS');
END
TABLE FILE CAR
PRINT
 CN_DATE
 DTETME_FROM_ALPHA
IF RECORDLIMIT EQ 1
END
SET DATEFORMAT = MDY 

CN_DATE     DTETME_FROM_ALPHA                                                 
-------     -----------------                                                 
28/03/2017  2017/03/28 00:00:00 

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Silver Member
posted Hide Post
Francis and David,

Thank you for the solutions. I can follow the syntax and the logic of what you both are suggesting.

I really hate to beleaguer the point, as you have both given me solutions, but have one more question:

How I translate this syntax, which I believe is native WebFocus Language, into the InfoAssist tool? Is there some documentation I could look at to explain what the differences in syntax are?

I know that learning the code is much more useful / powerful than relying on a tool, unfortunately I'm going to have to deploy the tool to other analysts in the future and will have a hard enough time getting them to learn the tool, and no chance on code.

Thank you again for taking the time to help.


WebFOCUS 8.2.0.1 / App Studio 8.2.0.1 (04092014) / Windows 7 / HTML5, PDF, XLS
 
Posts: 40 | Location: Kansas City, MO | Registered: June 10, 2013Report This Post
Expert
posted Hide Post
I don't use Info Assist so i can't help much, but there must be a way to add a new column, and use a function in this new column...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
InfoAssist has a Define in the Data tab under Detail(Define)


WebFOCUS 8.2.03 - Production
WebFOCUS 8.2.04 - Sand Box
Windows 2012 R2 Server
HTML, PDF, Excel
In FOCUS since 1980
 
Posts: 115 | Location: Seattle, WA | Registered: April 07, 2015Report This Post
Silver Member
posted Hide Post
There is definitely the way to do Detail(Defines), that's where I did all of the steps I mentioned in my original posts.

It just seems like InfoAssist places limitations on what can be entered in this area. I will do some more searching of the InfoAssist documentation to see what differences there are.

If someone else is most familiar w/ InfoAssist and has knowledge about these differences, please let me know! I'll leave this open for awhile longer and then change it to solved if I don't any more responses re: InfoAssist.

Thank you both for your help.


WebFOCUS 8.2.0.1 / App Studio 8.2.0.1 (04092014) / Windows 7 / HTML5, PDF, XLS
 
Posts: 40 | Location: Kansas City, MO | Registered: June 10, 2013Report 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] InfoAssist Conversion from non-standard A10 to HYYMDs/efficiencies

Copyright © 1996-2020 Information Builders