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     [CLOSED] Using "IF" correctly in a by statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Using "IF" correctly in a by statement
 Login/Join
 
Gold member
posted
Hi everyone,

I'm new to posting here and please forgive me if my lingo is incorrect in my topic name or something I post below. I use Webfocus 7.7

I work at a University and am trying to execute something normally I do in Excel in web focus. Typically I use something like this in Excel

IF(AND(A2=A1,B2=B1),2,1)

Basically, this tells me if the student ID & course code are the same (assuming correct sorting) then I have a student repeating a course.

I'm trying to do it with something like:

TERM_COUNT/I2 = IF (SHRTCKG_PIDM EQ LAST SHRTCKG_PIDM) AND (COURSE_CODE EQ LAST COURSE_CODE) THEN 2 ELSE 1 ;

But I keep getting errors like:

(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TERM_COUNT
(FOC009) INCOMPLETE REQUEST STATEMENT


Any thoughts on how to fix it?

CODE:

SET BYDISPLAY = ON
TABLE FILE GRADE_DISTRIBUTION_FINAL
BY SHRTCKG_PIDM
BY FEE_TYPE
BY ACADEMIC_YEAR
BY SHRTCKG_TERM_CODE
BY COURSE_CODE
BY SHRTCKG_GRDE_CODE_FINAL
BY GRADE_VALUE
WHERE COURSE_CODE EQ 'ENGL-105' OR 'CMNS-155';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS AA FORMAT ALPHA
ON TABLE SET HTMLCSS ON
END

JOIN
LEFT_OUTER AA.AA.SHRTCKG_PIDM IN AA TO MULTIPLE SORHSBJ.SORHSBJ.SORHSBJ_PIDM
IN SORHSBJ TAG J0 AS J0
END
JOIN
INNER J0.SORHSBJ.SORHSBJ_SBJC_CODE IN AA TO MULTIPLE
STVSBJC.STVSBJC.STVSBJC_CODE IN STVSBJC TAG J1 AS J1
END

SET BYDISPLAY = ON
TABLE FILE AA
BY SHRTCKG_PIDM
BY FEE_TYPE
BY ACADEMIC_YEAR
BY SHRTCKG_TERM_CODE
BY COURSE_CODE
BY SHRTCKG_GRDE_CODE_FINAL
BY GRADE_VALUE
BY TERM_COUNT/I2 = IF (SHRTCKG_PIDM EQ LAST SHRTCKG_PIDM) AND (COURSE_CODE EQ LAST COURSE_CODE) THEN 2 ELSE 1 ;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
END

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010Report This Post
Expert
posted Hide Post
You are not allowed to do calculations on sort fields.

You will need to add this to a compute or define.

You also may need to do this in two steps, but you can try using compute, then BY TOTAL with TERM_COUNT.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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     [CLOSED] Using "IF" correctly in a by statement

Copyright © 1996-2020 Information Builders