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     [SOLVED] Conditional Grouping

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Conditional Grouping
 Login/Join
 
Platinum Member
posted
Hello,

I have an excel report which has multiple sortfields - I am trying to further group by one of the sortfields based on a condition.

For example: I have a category where the amounts are either in US dollars or Canadian dollars - I am trying to separate the records with USD from those with CAD only when they fall in a particular category and not any other.

So I have categories: A,B,C,D and each one has records with amounts in both USD & CAD; but I am looking to separate records with USD & CAD only when category is A and not for others.

How can I do a conditional BY statement? Or is there another way to achieve this?

Thanks in advance!

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


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
Define a new column that determines the value based on the logic you just described. It'll look something like this:

 
NEW_AMOUNT/D12.2= IF CATEGORY EQ 'A' THEN AMOUNT ELSE 0; 
 


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
Ok I apologize, I think I didn't explain it correctly...

The currency code (USD or CAD) is the field which I have to separate based on the catergory.

For example:
The report looks like this-
CATEGORY A
Customer    Customer Name   Category  Trans  Amount   Currency   Country   Acct Num   Date
1111         test1            A         CR     10        USD       US       657869    08/01
3333         test3            A         CR     50        CAD       CA       55768     07/01
Total CR:                                      60

2222         test2            A         DB     15        USD       US       476657    07/30
Total DB:                                      15

CATEGORY B
Customer    Customer Name   Category  Trans  Amount   Currency   Country   Acct Num   Date
1111         test1            B         CR     10        USD       US       657869    08/01
Total CR for USD:                              10

3333         test3            B         CR     50        CAD       CA       55768     07/01
Total CR for CAD:                              50

2222         test2            B         DB     15        USD       US       476657    07/30
Total DB for USD:                              15


SO my BY statements are:
BY CATEGORY NOPRINT
BY TRANS NOPRINT
.......
ON CATEGORY PAGE-BREAK
ON TRANS SUBTOTAL
........
........


I need to group by based on currency code when category is B - please advise!


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
Is this may answer your need ?
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
ON COUNTRY SUBTOTAL
WHEN COUNTRY EQ 'ITALY' OR 'JAPAN';
END


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
Virtuoso
posted Hide Post
This might help:
 
DEFINE FILE xxxx
BCURR/A3=IF CATEGORY EQ 'B' THEN CURRENCY ELSE ' ';
...
END
TABLE FILE xxxx
....
BY CATEGORY NOPRINT
BY TRANS NOPRINT
BY BCURR NOPRINT
ON BCURR SUBTOTAL WHEN BCURR NE ' '

 


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
Platinum Member
posted Hide Post
Thanks a lot Danny.. Your solution worked Smiler

Thank you everyone for helping me out with this.


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
Nova, you're welcome.


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Conditional Grouping

Copyright © 1996-2020 Information Builders