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.
Hello I noticed something that troubles me ( maybe it's not a bug but I am not aware of the situation ). I have a define block with some new virtual fields defined but it seems that when I try to print some of them they are not printed correctly unless I print the other defined fields on which they depend. Here is a snippet of the code:
DEFINE FILE TABL1 col1_V1/D15.3 = col1_V1 + some_table_col1; col_new/D15.3 = col1_V1; col1_V1/D15.3 = IF some_ather_col NE LAST some_other_col THEN 0 ELSE col1_V1; END -RUN
TABLE FILE TABLE1 PRINT col1_new END -RUN
LET'S say I have two columns in table1 then the result is something like: col1_new -------- -200,000 .000
When I print col1_V1 with NOPRINT:
TABLE FILE TABLE1 PRINT col_V1 NOPRINT col1_new END -RUN
then there is no problem and col1_new prints as expected:
col1_new -------- -200,000 200,000
( I use then col1_new in a subfoot )
So why is this happening ?!? Thanks in advance.This message has been edited. Last edited by: Martin_fmi,
Here is the example with the CAR table ( the same strange behaviour - or at least strange to me )
DEFINE FILE CAR
WIDTH_T1/D6 = WIDTH_T1+WIDTH;
TEMPVAR/D6 = WIDTH_T1;
WIDTH_T1/D6 = IF MODEL NE LAST MODEL THEN 0 ELSE WIDTH_T1;
END
-RUN
TABLE FILE CAR
PRINT
TEMPVAR
WIDTH_T1 NOPRINT
END
-RUN
-EXIT
Try printing it without WIDTH_T1 NOPRINT and you'll see that different result prints for TEMPVAR . ( I am using WF 7.6.5 ) I am using the Dev Studio under XP.This message has been edited. Last edited by: Martin_fmi,
By using WIDTH_T1 NOPRINT it causes WIDTH_T1/D6 = IF MODEL NE LAST MODEL THEN 0 ELSE WIDTH_T1; to be processed This sets WIDTH_T1 back to 0 for every new row.
Because it is created in a DEFINE and not a compute, not referencing WIDTH_T1 in the request means that the calculation is never performed and so WIDTH_T1 does not get set back to 0.
Each new output row is then EQ to the last value of WIDTH_T1 + the value of the new input row.
I see - hammo you probably meant that I should leave the field with NOPRINT. Because my purpose is to print the TEMPVAR field but when MODEL changes WIDTH_T1 is set to 0 ( and TEMPVAR preserves the value of WIDTH_T1 to be used later). Thanks both for the response.
I am wondering, is there a way to force WF (maybe by an option) to compute all the fields that are created in a define, so that we avoid using NOPRINT?
Think about things logically and reverse the order of the defined columns
DEFINE FILE CAR WIDTH_T1/D6 = IF MODEL NE LAST MODEL THEN 0 ELSE WIDTH_T1; WIDTH_T1/D6 = WIDTH_T1+WIDTH; TEMPVAR/D6 = WIDTH_T1; END -RUN TABLE FILE CAR PRINT TEMPVAR END -RUN
That actually does what you want in this instance
Using model as the change column is actually a bad choice because there is only 1 row in the data for MODEL.
Use COUNTRY instead and you see the effect which I believe is required which is to give a running total based on doing a print