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     Ranking with amper variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Ranking with amper variable
 Login/Join
 
Gold member
posted
Hi everyone -

Does anyone know if you can use RANK or BY HIGHEST with an amper variable? Whenever I try it, I keep getting an error that it doesn't recognize the amper character. I want to allow my end users to select the number of records they want to see. The report is a Top Customer report by Sales Rep. They want to be able to select how many top customers...i.e. either by Top 5 or Top 10 or Top 20, etc. for each rep.

Thanks!


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
SOS,

Example:

  
-DEFAULT &USER_PICK='10'
-SET &BY1 = 'BY TOP ' | '&USER_PICK.EVAL' | ' PRODUCT';
TABLE FILE GGSALES
SUM DOLLARS
&BY1
END
-EXIT


Other examples will follow...

Hope this helps...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
How are you coding it?

-DEFAULT &Kount = 5
TABLE FILE EMPDATA
PRINT FIRSTNAME MIDINITIAL LASTNAME
   BY HIGHEST &Kount SALARY
END

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
Gold member
posted Hide Post
TABLE FILE INVOICE_DATA
SUM
SHIPPED_QUANTITY AS 'Units'
GROSS_DISC_EXT/D12.2CM AS 'Sales'
LY_UNITS AS 'LY Units'
LY_SALES AS 'LY Sales'
BY REP1_KEY NOPRINT AS 'Rep Key'
RANKED AS 'RANK' BY TOTAL HIGHEST 10 GROSS_DISC_EXT NOPRINT
BY CUSTOMER_CODE AS 'Acct Num'
BY CUSTOMER_DESC AS 'Customer Name'
ON REP1_KEY SUBHEAD
" "
"ON REP1_KEY SUBTOTAL AS 'TOTAL'
HEADING
"TOP CUSTOMER SALES BY REP/ACCOUNT NUMBER"
"FOR &YEAR"
" "
FOOTING
""


And I need the BY HIGHEST to be a variable.


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
sos,

Then, based on your code, and, the above examples, "YOU" can accomplish your task...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
sorry, lightbulb just came on....I need another cup of coffee. Thanks Tom! And thank you so much, Tony!


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
One last thing...the report runs great but I'm getting a parsing error when I try to open the report painter. Any ideas?

Here's the new code:

TABLE FILE INVOICE_DATA
SUM
SHIPPED_QUANTITY AS 'Units'
GROSS_DISC_EXT/D12.2CM AS 'Sales'
LY_UNITS AS 'LY Units'
LY_SALES AS 'LY Sales'
BY REP1_KEY NOPRINT AS 'Rep Key'
BY TOTAL HIGHEST &KOUNT GROSS_DISC_EXT NOPRINT
BY CUSTOMER_CODE AS 'Acct Num'
BY CUSTOMER_DESC AS 'Customer Name'
ON REP1_KEY SUBHEAD
" "
"ON REP1_KEY SUBTOTAL AS 'TOTAL'
HEADING
"TOP CUSTOMER SALES BY REP/ACCOUNT NUMBER"
"FOR &YEAR"
" "
FOOTING
""


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Yes. Don't open it in the Report Painter. It just hasn't quite caught up with the code yet, so it doesn't understand everything you can do in the code. I would suspect it is the BY TOTAL HIGHEST &KOUNT GROSS_DICS_EXT NOPRINT lines. RP would not know what to do with an &parm where syntactically it would expect an argument.

You might try a -DEFAULT &KOUNT=10 at the beginning and change to BY TOTAL HIGHEST &KOUNT.EVAL ... RP might feel a little more comfy with that code.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
Thanks Darin. The RP does seem to have issues when you "cheat" on it, doesn't it? It didn't care for the .eval either, but thanks for confirming the problem. I guess if I need to edit in the painter, I can always comment out the code and then remove the comment when I'm done.

Have a great day - thanks everyone for the help!


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Well, that brings up another little nicety - If you comment out the code, when you open it in RP, it moves all the comments to the very top of the procedure. So you'll need to remember (or include in the comment) where the commented code was supposed to be in the fex.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
Y'know, I forgot all about that so I just tested it. Now I've either just gone over the rainbow and landed somewhere where things actually work right (little Kansas humor there) or RP is trying to fake me out.

I commented out the line of offensive code, saved and returned to the painter. I made one change and saved. When I returned to the code, the commented out line was in the right place, just commented out. Is that supposed to happen? Or maybe they fixed this little "glitch" in 7.6.2? Either way, it's a-working and I'm a-happy.

Thanks for your help Darin! Smiler


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Yes, it does that.
I find this a little bit annoying.
But I also think that if I would have had to code the report painter, I'd probably do it the same way. There simply is too much that we can do with the focus code, the painter will probably never reach that level.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
quote:
""FOR &YEAR"
" "

Glad your happy, but your posted code did have a 'double' double quote in it which could cause a parsing issue.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
Thanks Leah, but that always happens whenever I try to post headers, it cuts off the parts of the header. I double checked to make sure, but the post just took out the rest of the line that was there.

Thank you for calling it to my attention. Have a great 4th!


PROD: WebFocus 7.6.9 on WinXP
 
Posts: 59 | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Shelli, here's that focexec I emailed you about.

 
TABLE FILE EMPDATA 
    BY DIV 
        RANKED  AS 'RANK' BY &SORT_ORDER &LIMIT SALARY
    BY LASTNAME
END
 


WF 7.7.03, Windows 7, HTML, Excel, PDF
 
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Report This Post
Expert
posted Hide Post
to quote Darin
"don't open it in report painter"
is definitely a t-shirt slogan for Summit 09! Big Grin




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Sosterle,

quote:
Thanks Leah, but that always happens whenever I try to post headers, it cuts off the parts of the header. I double checked to make sure, but the post just took out the rest of the line that was there.


When you post a focexec, because of the carets, use the QUOTE /QUOTE tags around your post (the right-most icon on the message ribbon) and you won't have anything disappear.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Guru
posted Hide Post
quote:
Originally posted by sosterle:
Thanks Darin. The RP does seem to have issues when you "cheat" on it, doesn't it? It didn't care for the .eval either,


the rule of thumb is dont use the editor and painter - only use one and try and stick to it... i personally can't see why it would be an issue, surely if you view a fex in the painter the command could be edited so it ignores the lines that causes it to fail...

DM can't be represented graphically so why not just ensure the painter never tries to interpret it- like

'IGNORE LINES STARTING WITH -'

surely it ignores the comment lines using a similar logic so i think it should be expanded, also get it to ignore &&INCLUDE.

the point would be to get the painter working with the elements that can be displayed graphically as i doubt people ever switch from code to the painter to look at DM stuff....

and if its not a default perhaps an option? where you can decide which code lines get ignored if being opened with the painter?

unless im missing something but to me it seems the obvious route to elevate DS to a more professional product


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Expert
posted Hide Post
nubi,

Hmmm, I see your logic and I agree that the movement of comment and DM code is just ludicrous, but ......

&&INCLUDE is not a supplied global variable so it must be one particular to your installation. This implies that you would like all global variables to be ignored? Where would you stop?

There are many things where many GUIs (not just IB GUIs) fall short of providing the ulitmate UI but what is good for one isn't necessarily good for another and a compromise has to be reached.

As you are probably aware (I've said as much many times), I'm not a fan of the GUI but I will use it for a purpose, and that is to provide the basics from which I can manually extend my code. I suppose I've learnt to adapt and having always coded FOCUS manually (GUIs are "new") my preference remains in my history, but I can see how those used to certain UIs can get very frustrated at some that are out there.

[JMTC]

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
Expert
posted Hide Post
thank god for gui's when it comes to JOINS...
nooooobody wants to type all those qualifiers
unless of course you're billing by the hour... Smiler




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
quote:
&&INCLUDE is not a supplied global variable so it must be one particular to your installation. This implies that you would like all global variables to be ignored? Where would you stop?


a good point, perhaps as its the .EVAL that it fails on it could ignore any instance of .EVAL instead of &&INCLUDE.

im not sure how many of the global variables could be displayed so i think there is definitely a case for reviewing it - and whilst ive not used a huge number of packages ive never used one which gives you the option of coding via different routes but not letting you switch between them....

would i raise a case? no, its been beneficial to me as ive just worked from the code editor straight away and feel i have a far better understanding of WF than if i had relied on the painter...its just an annoyance and an option to choose which elements the painter ignores could be a good compromise....

[JMTP]
(just my two penneth) Big Grin


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report 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     Ranking with amper variable

Copyright © 1996-2020 Information Builders