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.
-SET &ECHO=ALL;
-*SET NODATA=0;
DEFINE FILE CAR
COUNTR/I11= IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE 0;
CARS/I11= IF CAR EQ 'TOYOTA' THEN 1 ELSE 0;
STS/I11= IF SEATS EQ 2000 THEN 1 ELSE 0;
SLS/I11= IF SALES EQ 100000 THEN 1 ELSE 0;
ACL/I11= IF ACCEL EQ 777 THEN 1 ELSE 0;
DEALER_COST/D20.2= IF DEALER_COST GT 1000 THEN 1 ELSE 0;
RETAIL_COST/D20.2= IF RETAIL_COST GT 2000 THEN 1 ELSE 0;
SNO/I11 = IF COUNTR GE 1 THEN 1 ELSE
IF CARS GE 1 THEN 2 ELSE
IF STS GE 1 THEN 3 ELSE
IF SLS GE 1 THEN 4 ELSE
IF ACL GE 1 THEN 5 ;
END
TABLE FILE CAR
PRINT
-*COUNTR
DEALER_COST
RETAIL_COST
BY SNO
END
I was in need of the SNO irrespective whether the value is true or false. In the above code I get the SNO only when the value is 1 .Please provide me any suggestions as how I can get the SNO in sequence whether the value is 1 or 0.
Regards, MSAMThis message has been edited. Last edited by: Kerry,
Are you looking for LIST or something like row number, then here it is
TABLE FILE CAR
PRINT
COMPUTE SNO/I11=SNO+1;
COUNTRY
CAR
BY COUNTRY NOPRINT
BY CAR NOPRINT
END
TABLE FILE CAR
LIST
COUNTRY
CAR
BY COUNTRY NOPRINT
BY CAR NOPRINT
END
DEFINE FILE CAR
COUNTR/I11= IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE 0;
CARS/I11= IF CAR EQ 'TOYOTA' THEN 1 ELSE 0;
STS/I11= IF SEATS EQ 222 THEN 1 ELSE 0;
SLS/I11= IF SALES EQ 0 THEN 1 ELSE 0;
ACL/I11= IF ACCEL EQ 777 THEN 1 ELSE 0;
DEALER_CO/I11= IF DEALER_COST GT 1000 THEN 1 ELSE 0;
RET_CO/I11= IF RETAIL_COST GT 1000 THEN 1 ELSE 0;
SNO/I11= IF COUNTR GE 1 THEN 1 ELSE
IF CARS GE 1 THEN 2 ELSE
IF STS GE 1 THEN 3 ELSE
IF SLS GE 1 THEN 4 ELSE
IF ACL GE 1 THEN 5 ELSE 5 ;
-* IF DEALER_CO GE 1 THEN 6 ELSE
-* IF RET_CO GE 1 THEN 7 ELSE 7;
END
-*
TABLE FILE CAR
SUM
COUNTR
CARS
STS
SLS
ACL
DEALER_CO
RET_CO
BY SNO
-*ON TABLE HOLD AS HOLD1
END
-EXIT
The SNO value gets skipped when the value of the DEFINE field is 0.. Please suggest an idea..
Waz, What actually I'm trying to do is to generate a SNO based on the DEFINE fields so that I can use it as a FOR Field by joining to another table that has a SNO. But as per my above code the DEFINE fields generate the SNO only when the value is 1 and it stops at the DEFINE which ever has the value 0. I need to get the SNO for the above DEFINE fields irrespective whether the value returned is 1 or 0.Can we do that as per my logic or I'm I going in the wrong direction..
If you are not getting a zero, then your not getting a zero.
But....
If you use some of the techniques specified in this forum, then you can force the existance of the zero.
e.g.
DEFINE FILE CAR
COUNTR/I11= IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE 0;
CARS/I11= IF CAR EQ 'TOYOTA' THEN 1 ELSE 0;
STS/I11= IF SEATS EQ 222 THEN 1 ELSE 0;
SLS/I11= IF SALES EQ 0 THEN 1 ELSE 0;
ACL/I11= IF ACCEL EQ 777 THEN 1 ELSE 0;
DEALER_CO/I11= IF DEALER_COST GT 1000 THEN 1 ELSE 0;
RET_CO/I11= IF RETAIL_COST GT 1000 THEN 1 ELSE 0;
SNO/I11= IF COUNTR GE 1 THEN 1 ELSE
IF CARS GE 1 THEN 2 ELSE
IF STS GE 1 THEN 3 ELSE
IF SLS GE 1 THEN 4 ELSE
IF ACL GE 1 THEN 5 ELSE 5 ;
-* IF DEALER_CO GE 1 THEN 6 ELSE
-* IF RET_CO GE 1 THEN 7 ELSE 7;
END
-*
TABLE FILE CAR
SUM
COUNTR
CARS
STS
SLS
ACL
DEALER_CO
RET_CO
BY SNO ROWS 0 OVER 1 OVER 2 OVER 3 OVER 4 OVER 5
-*ON TABLE HOLD AS HOLD1
END
-EXIT
Just note that SNO after a HOLD does not exist, you will have to reference it by E01.