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     [SOLVED] Help with 'LAST'

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Help with 'LAST'
 Login/Join
 
Gold member
posted
Hi,

I have the following situation:
Num
10
20
30
70
80

I need to set a marker so that automatically the first row is marked as 1, but any row after that, that is 10 more than the previous is marked as 1. But as soon as there is a break in the sequence then all the rest are marked as 0. So in the case above 10, 20 and 30 would be have a marker of 1 as they are all in sequence. But even though 80 is 10 more than 70, both 70 and 80 would have a marker of 0 since there was a gap in the sequence becasue 40, 50 and 60 do not exist.

So far this is where I am:

DEFINE FILE HTEMP
MARKER/I1 = IF (LAST NUM + 10) EQ NUM THEN 1 ELSE 0;
END

TABLE FILE HTEMP
LIST
NUM
MARKER
END


This unfortunately does not work when the start in the sequence is greater than 10, also I'm not sure how to deal with a break in the sequence. Hopefully this makes some sense Razzer

Any ideas?

Thanks!

Jinx.

This message has been edited. Last edited by: Jinx,


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report This Post
Expert
posted Hide Post
DEFINE FILE HTEMP
CNTR/I2=CNTR+1;
MARKER/I1=IF CNTR EQ 1 THEN 1 ELSE IF MARKER EQ 0 THEN 0 ELSE
          IF NUM - LAST NUM EQ 10 THEN 1 ELSE 0;
END
TABLE FILE HTEMP
PRINT CNTR NUM MARKER
END

Does this do it for you?

quote:
This unfortunately does not work when the start in the sequence is greater than 10


I think it works for this as well.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
GENIUS! Thanks a million Ginny, you saved me a lot of code.


7.6.11
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus IBM
SQL Server 2000 / 2008
DB2
 
Posts: 78 | Location: UK | Registered: February 07, 2008Report 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     [SOLVED] Help with 'LAST'

Copyright © 1996-2020 Information Builders