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     Any explanation ( strange behaviour ) ?!?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Any explanation ( strange behaviour ) ?!?
 Login/Join
 
Silver Member
posted
 TABLE FILE CAR
PRINT COUNTRY
TABPAGENO NOPRINT
AND COMPUTE NUM/I10 = IF MODEL NE LAST MODEL THEN 3 ELSE (IF TABPAGENO NE LAST TABPAGENO THEN NUM+11 ELSE NUM);
END
-EXIT

 


The result for the first row is 14 , i.e. 'if' and 'else' are both entered ...


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Expert
posted Hide Post
TABLE FILE CAR
PRINT COUNTRY MODEL
TABPAGENO 
AND COMPUTE MODEQ/I1=IF MODEL EQ LAST MODEL THEN 1 ELSE 0;
AND COMPUTE TP/I1=IF TABPAGENO EQ LAST TABPAGENO THEN 1 ELSE 0;
AND COMPUTE NUM/I10 = IF MODEL NE LAST MODEL THEN 3 ELSE (IF TABPAGENO NE LAST TABPAGENO THEN NUM+11 ELSE NUM);
END

i think if you run this snip, you'll see why.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Silver Member
posted Hide Post
I don't see why ...

 TABLE FILE CAR
PRINT
COUNTRY
AND COMPUTE VAL1/I10 = IF MODEL NE LAST MODEL THEN 3 ELSE IF COUNTRY NE LAST COUNTRY THEN VAL1 + 11 ELSE VAL1;
AND COMPUTE VAL2/I10 = IF MODEL NE LAST MODEL THEN 3 ELSE IF TABPAGENO NE LAST TABPAGENO THEN VAL2 + 11 ELSE VAL2;
END
-RUN
-EXIT
 


It is evident for the first row that "model ne last model" so else should not be entered ... Maybe I misunderstand something ...


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
<JG>
posted
Certainly seems to be something wrong in the internal matrix.

 
TABLE FILE CAR 
PRINT COUNTRY 
TABPAGENO NOPRINT
COMPUTE LSTMODEL/A50=LAST MODEL;
AND COMPUTE NUM/I10 = IF MODEL NE LSTMODEL THEN 3 ELSE 
                       IF TABPAGENO NE LAST TABPAGENO THEN NUM+11 ELSE NUM;
END
 
 
Report This Post
Guru
posted Hide Post
This is fixed with adding sorts:

TABLE FILE CAR
PRINT COUNTRY
TABPAGENO NOPRINT
AND COMPUTE NUM/I10 = IF MODEL NE LAST MODEL THEN 3 ELSE IF TABPAGENO NE LAST TABPAGENO THEN (NUM+11) ELSE NUM;
BY MODEL BY TABPAGENO
END
-EXIT


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
Virtuoso
posted Hide Post
Here's what I surmise is happening, in execution of Martin's original code.

TABPAGENO is unique: You can reference it as a verb object, but its value is (obviously) not determinable until formatting of the output pages is in motion. Ultimately, page-break points (and hence the page-number of a row in the matrix) may depend on conditional subhead and subfoot lines, which in turn depend on matrix columns, both the accumulated verb-object columns and the Computed columns in the matrix.

Space is allocated in the internal matrix for the TABPAGENO column, and for any COMPUTE columns that depend on it, and for their LAST values -- but they have to remain unevaluated (zero or blank) until the page-break calculation phase, after all other computes are evaluated.

The bug seems to be two-fold.

First, the Computes that depend on TABPAGENO (and/or LAST TABPAGENO) are being evaluated twice -- once (prematurely) along with "normal" computes, and again (deservedly) at page-formatting time -- such that the first evaluation polutes values used in the second evaluation.

Second, the pushdown of matrix columns into their LAST-value columns for "normal" columns (such as MODEL) is being done (prematurely) before the computes in the page-formatting phase.

As a result...

In the first evaluation of
NUM/I10 = IF MODEL NE LAST MODEL THEN 3 ELSE (IF TABPAGENO NE LAST TABPAGENO THEN NUM+11 ELSE NUM);
for the first row, LAST MODEL is blank, so MODEL and LAST MODEL are unequal, and NUM gets the value 3.

Then, in the second evaluation (after TABPAGENO is evaluated), MODEL and LAST MODEL are equal (both contain "V12XKE AUTO"), while TABPAGENO and LAST TABPAGENO are unequal, so NUM gets "NUM+11" which is 3+11=14. (QED)


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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     Any explanation ( strange behaviour ) ?!?

Copyright © 1996-2020 Information Builders