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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
dynamic By fields
 Login/Join
 
Gold member
posted
Hi,

I am new to WebFOCUS. I am trying to group by/ total dynamically depending on the parameters passed.

For example:
If I pass &GROUPBY = 1 as a parameter, then I want the report to have "Region" as By field(and subtotal accordingly).
&GROUPBY = 2 then 'Area'(as By field)
&GROUPBY = 3 then 'Branch'(as By field)
&GROUPBY = 4 then 'Businsess'(as By field)...etc.,.

Is there a way to this ?

Thanks.


7.7.03, Windows 7, SQL Server 2005
 
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008Report This Post
Guru
posted Hide Post
Shravan,

You can do this by coding such as
-SET &BYSORT=IF &GROUPBY EQ '1' THEN 'Region'
- ELSE IF IF &GROUPBY EQ '2' THEN 'Area' ETC.

Then in your .fex do a
PRINT FIELD1 ...
BY &SORTBY.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Gold member
posted Hide Post
If the GROUPBY parameter contains the name of the field, then it would be as simple as asigning &GROUPBY to be the sort field. If GROUPBY is a number, you will have to create a new parameter with the actual name.

From the painter, you can then drag the parameter onto the report just as it were another field.


-SET &SORTFLD = DECODE &GROUPBY (1 'REGION'
-  2 'AREA' 3 'BRANCH' 4 'BUSINESS');

TABLE FILE myfile
PRINT
  field1
  field2
BY &SORTFLD
END



Windows: WF 7.6.2: SQL Server 2008 R2
 
Posts: 86 | Location: Chicago | Registered: August 03, 2007Report This Post
Gold member
posted Hide Post
It works ! Thanks RSquared. Thanks Gizmo. It was great help !

I may have another question. If the user can pass 1,2 & 3 the report should be able to group by Region then by Area and then by Branch. I am going to try this by myself (and may be come back Smiler).


7.7.03, Windows 7, SQL Server 2005
 
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008Report This Post
Gold member
posted Hide Post
I am not able to find the correct syntax to sort by mutliple fields dynamically.

For example if the user passes 1, the report should be able to sort BY just Region, if the user passes 10, the report should be able to sort BY Region and also Area. Is it possible ? Can somebody please advise ?

Thanks.


7.7.03, Windows 7, SQL Server 2005
 
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008Report This Post
Virtuoso
posted Hide Post
I don't know what 1 and 10 are , so i don't know how to answer. Best way to do what you need is to set up some dialogue manager commands. If you are passing three parameters, each of which can have a value or not, then
-SET &BYFLD1=IF '&parm1.EVAL' NE '' THEN 'BY &parm1 SUBTOTAL' ELSE '';
-SET &BYFLD2=IF '&parm2.EVAL' NE '' THEN 'BY &parm2 SUBTOTAL' ELSE '';
-SET &BYFLD3=IF '&parm3.EVAL' NE '' THEN 'BY &parm3 SUBTOTAL' ELSE '';


Then in your report you can just say
&BYFLD1.EVAL
&BYFLD2.EVAL
&BYFLD3.EVAL

If the parms have values, you get sorts and subtotals. If the parms are blank, you don't get sorts and subtotals.

This message has been edited. Last edited by: Darin Lee,


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
Darin,

Even though I did not communicate my question correctly, you understood it. The solution you suggested was what I needed. Thank you very much. It's just been 2 days since I've joined this forum. I already started liking it.

Thanks.


7.7.03, Windows 7, SQL Server 2005
 
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders