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     How to make a Column that counts rows?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to make a Column that counts rows?
 Login/Join
 
Gold member
posted
Hi All.

I am trying to make a recursive count in a column so that effectively each row is numbered. Any suggestions?

Column
1
2
3
4
5
6 (and so on)


WebFocus 8.104
Windows 7 Entreprise, SP1
 
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010Report This Post
Silver Member
posted Hide Post
Hi Max,
you can use RANKED function to display count in the column.
TABLE FILE CAR
PRINT CAR MODEL 
RANKED BY HIGHEST 5 RETAIL_COST
END


WebFOCUS 8.0.08 - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
Windows, All Outputs
 
Posts: 40 | Registered: April 02, 2014Report This Post
Expert
posted Hide Post
  
TABLE FILE CAR
LIST
    RETAIL_COST
    DEALER_COST
 BY COUNTRY
 BY CAR
END
-EXIT

OR
  
TABLE FILE CAR
SUM
    RETAIL_COST
    DEALER_COST
       COMPUTE CNTR/I3 = CNTR + 1; NOPRINT
 BY TOTAL CNTR
 BY COUNTRY
 BY CAR
END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Simply as...

Count up to 10 cars:
DEFINE FILE CAR
ID /I5 = ID + 1;
END
TABLE FILE CAR
BY ID
BY CAR
END


Count up to 18 models:
DEFINE FILE CAR
ID /I5 = ID + 1;
END
TABLE FILE CAR
BY ID
BY MODEL
END


Or to have a count reset on BY:
TABLE FILE CAR
PRINT COMPUTE ID /I5 = IF COUNTRY EQ LAST COUNTRY THEN ID + 1 ELSE 1;
      MODEL
BY COUNTRY
END

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Thanks for the replies guys - I got it! Smiler


WebFocus 8.104
Windows 7 Entreprise, SP1
 
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010Report 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     How to make a Column that counts rows?

Copyright © 1996-2020 Information Builders