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 need to construct some logic to check a 12 month period and display the first value that is greater than zero. In my if-then logic I need it to stop after the first value is found.This message has been edited. Last edited by: Kerry,
Yes its been a long day. But what I need to do is check 12 monthly buckets (Jan - December) If the value in January is greater than zero display that value. But if January is zero I need to check each bucket until I have a value. If there is no value in any of the 12 months then display a zero. For example:If there is a value in February I need to stop so I don't add March. I need to display February and stop processing.
NEWAMT/D6 =
IF JANAMT GT 0 THEN JANAMT ELSE
IF FEBAMT GT 0 THEN FEBAMT ELSE
IF MARAMT GT 0 THEN MARAMT ELSE
IF APRAMT GT 0 THEN APRAMT ELSE
IF MAYAMT GT 0 THEN MAYAMT ELSE
IF JUNAMT GT 0 THEN JUNAMT ELSE
IF JULAMT GT 0 THEN JULAMT ELSE
IF AUGAMT GT 0 THEN AUGAMT ELSE
IF SEPAMT GT 0 THEN SEPAMT ELSE
IF OCTAMT GT 0 THEN OCTAMT ELSE
IF NOVAMT GT 0 THEN NOVAMT ELSE DECAMT;
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
The buckets are in columns, so the problem is that,if for example FEBAMT was greater than zero, instead of ending, it still checks MARAMT therefore NEWAMT is then overstated.
NEWAMT/D6 = IF JANAMT GT 0 THEN JANAMT ELSE IF FEBAMT GT 0 THEN FEBAMT ELSE IF MARAMT GT 0 THEN MARAMT ELSE IF APRAMT GT 0 THEN APRAMT ELSE IF MAYAMT GT 0 THEN MAYAMT ELSE IF JUNAMT GT 0 THEN JUNAMT ELSE IF JULAMT GT 0 THEN JULAMT ELSE IF AUGAMT GT 0 THEN AUGAMT ELSE IF SEPAMT GT 0 THEN SEPAMT ELSE IF OCTAMT GT 0 THEN OCTAMT ELSE IF NOVAMT GT 0 THEN NOVAMT ELSE DECAMT;
Donald, Francis's solution does what you want, except it should end
IF NOVAMT GT 0 THEN NOVAMT ELSE IF DECAMT GT 0 THEN DECAMT ELSE 0;
IF - THEN - ELSE terminates processing as soon as a condition (either posative or negative) is met.
NEWAMT/D6 =
IF JANAMT GT 0 THEN JANAMT ELSE
IF FEBAMT GT 0 THEN FEBAMT ELSE
IF MARAMT GT 0 THEN MARAMT ELSE
IF APRAMT GT 0 THEN APRAMT ELSE
IF MAYAMT GT 0 THEN MAYAMT ELSE
IF JUNAMT GT 0 THEN JUNAMT ELSE
IF JULAMT GT 0 THEN JULAMT ELSE
IF AUGAMT GT 0 THEN AUGAMT ELSE
IF SEPAMT GT 0 THEN SEPAMT ELSE
IF OCTAMT GT 0 THEN OCTAMT ELSE
IF NOVAMT GT 0 THEN NOVAMT ELSE DECAMT;
should be
NEWAMT/D6 =
IF JANAMT GT 0 THEN JANAMT ELSE
IF FEBAMT GT 0 THEN FEBAMT ELSE
IF MARAMT GT 0 THEN MARAMT ELSE
IF APRAMT GT 0 THEN APRAMT ELSE
IF MAYAMT GT 0 THEN MAYAMT ELSE
IF JUNAMT GT 0 THEN JUNAMT ELSE
IF JULAMT GT 0 THEN JULAMT ELSE
IF AUGAMT GT 0 THEN AUGAMT ELSE
IF SEPAMT GT 0 THEN SEPAMT ELSE
IF NOVAMT GT 0 THEN NOVAMT ELSE
IF DECAMT GT 0 THEN DECAMT ELSE 0;
I see no reason for this. DECAMT could be greater than or equal to zero - my and your code will evaluate to the correct value.
Thanks,
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
FM - I agree with (the other) JG. Donald expects a non-negaive result, and did not say that the buckets can't be negative. If (say) all 12 were neg, the result should be zero or missing, but not December's value.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005