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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


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: 2410 | 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