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.
I have a merged file with 3 different date fields. I need to condition which one actually prints on a report based on the value of another field. Is this possible?
example: If tran_type = 'R' Print dateAA else If tran_type = 'E' Print dateBB else If tran_type = 'A' Print dateCC
Report looks something like this: Name tran_type Date count John R 07/11 40 John E 08/01/2011 29 John A 31 Amy R 09/10 17 Amy R 12/11 7 Amy E 07/14/2011 21 Bill R 02/11 44 Bill R 12/11 19 Bill E 08/01/2011 21This message has been edited. Last edited by: Kerry,
WebFOCUS 7.7.03 Windows 7
Posts: 55 | Location: USA | Registered: November 02, 2009
Well that report sample didn't come out right, try it again..
Name tran_type Date count John R 07/11 40 John E 08/01/2011 29 John A 31 Amy R 09/10 17 Amy R 12/11 7 Amy E 07/14/2011 21 Bill R 02/11 44 Bill R 12/11 19 Bill E 08/01/2011 21
WebFOCUS 7.7.03 Windows 7
Posts: 55 | Location: USA | Registered: November 02, 2009
DEFINE or COMPUTE
PRINT_DATE/{format} = IF TRAN_TYPE EQ 'R' THEN dateAA ELSE
IF TRAN_TYPE EQ 'E' THEN dateBB ELSE
IF TRAN_TYPE EQ 'A' THEN dateCC ELSE {other date} ;
getting If then else syntax error. I'm new at this for WF so I must be missing something. Here is actual: COMPUTE PRINT_DATE/A20V = IF MERGE.MERGE.TYPE EQ 'R' THEN MERGE.MERGE.MMYY ELSE IF MERGE.MERGE.TYPE EQ 'E' THEN MERGE.MERGE.OLDEST ELSE IF MERGE.MERGE.TYPE EQ 'A' THEN MERGE.MERGE.ALL ;
WebFOCUS 7.7.03 Windows 7
Posts: 55 | Location: USA | Registered: November 02, 2009
Please post a copy of your error message. It may have something to do with the fieldname: "TYPE" (MERGE.MERGE.TYPE). But, a closer look at the error message and number may prove otherwise...
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, 2005
The dates are different formats, 1 is yymd and the other 2 are A20V so I will have to convert the date formatted one in the if statement? When I commented that date out, it ran.
WebFOCUS 7.7.03 Windows 7
Posts: 55 | Location: USA | Registered: November 02, 2009
Yes Brenda. Your PRINT_DATE compute field is defined as A20V and therefore it expects that every result sent to it is an alphanumeric value. If your expression contains numbers or dates then they have to be converted to alphas.
You can use DATECVT to convert dates to alpha, and EDIT/FTOA/PTOA to convert numbers to alpha.
I figured so. Using the DEFINE line I posted above takes care of converting your date into an alpha field [ DATECVT(date, 'YYMD',' A8YYMD) ] and then formatting it by adding "/" in between the components.
Not functionally different from your original logic but you'll be saving yourself 3 temporary fields from the internal matrix for each processed row. Yeah, even on this day and time I still worry about saving one byte here and there
Yes, thank you that worked as well and cleaner. I knew there had to be an easier way but being fairly new at this, couln't put it together from looking at the help.
I took classed over 3 years ago and by the time we installed WF I had been pulled off on other projects. I am just now getting my feet wet again and it has been a struggle. The old saying "what you don't use you loose" is so true. But, I am getting there.
Thanks again
WebFOCUS 7.7.03 Windows 7
Posts: 55 | Location: USA | Registered: November 02, 2009
Well, better late than never to get back to dive into WebFOCUS waters! Just don't give up Brenda and keep both the WF documentation and the URL to this forum nearby as it has been (and continues to be) of great help to many of us.
As other folks in this forum have said before, happy WebFOCUS sailing!