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 increment a value in a subhead

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to increment a value in a subhead
 Login/Join
 
Guru
posted
Hi,
I'm wanting a field that increments everytime a subhead is printed. I tried this but didn't quite get what I wanted...
DEFINE FILE CAR
KOUNT3/I1=3;
KOUNT/I4 WITH COUNTRY=IF KOUNT GT KOUNT3 THEN KOUNT+1 ELSE 4;
END
TABLE FILE CAR
SUM
     DEALER_COST
     RETAIL_COST
BY COUNTRY
BY CAR
BY BODYTYPE
ON COUNTRY SUBHEAD
" INCREMENTER HEADING VALUE IS <KOUNT "
ON COUNTRY SUBTOTAL AS '*TOTAL COUNTRY'
ON CAR SUBTOTAL AS '*TOTAL CAR'
ON BODYTYPE SUBTOTAL MULTILINES AS '*TOTAL BODYTYPE'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
ENDSTYLE
END


I wanted the increments to go in numerical order. The defines doesn't quite work because it gets processed before the sort and the where clauses. So, it increments in the original file order and it increments even if the country is eliminated in a where clause.

Any ideas?


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Expert
posted Hide Post
Anatess,

Convert them to COMPUTEs with NOPRINT and make sure KOUNT3 is also specified WITH COUNTRY.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
 TABLE FILE CAR
SUM
     DEALER_COST
     RETAIL_COST
	 COMPUTE COUNTIT/I4 = IF COUNTRY EQ LAST COUNTRY THEN COUNTIT ELSE COUNTIT + 1;  NOPRINT
BY COUNTRY
BY CAR
BY BODYTYPE
ON COUNTRY SUBHEAD
" INCREMENTER HEADING VALUE IS <COUNTIT "
ON COUNTRY SUBTOTAL AS '*TOTAL COUNTRY'
ON CAR SUBTOTAL AS '*TOTAL CAR'
ON BODYTYPE SUBTOTAL MULTILINES AS '*TOTAL BODYTYPE'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
ENDSTYLE
END

Tony is too fast for me, code above shows what he is talking about.
  


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
Ah, but it just goes to prove that great minds think alike?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Awesome! Thank you Leah and Tony (the great minds network). I added a tweak since my data has a null BY value and
COMPUTE COUNTIT/I4 = IF COUNTRY EQ LAST COUNTRY THEN COUNTIT ELSE COUNTIT + 1;


will not increment on that first null record.

So now its something like this:
COMPUTE COUNTIT/I4 = IF COUNTRY EQ LAST COUNTRY AND (COUNTIT GT 0) THEN COUNTIT ELSE COUNTIT + 1;


This forum is awesome.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report 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 increment a value in a subhead

Copyright © 1996-2020 Information Builders