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     [CLOSED] Different Count calculation for Column values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Different Count calculation for Column values
 Login/Join
 
Platinum Member
posted
I have a requirement where i am calculating count of different values from a column.
Eg:
  
TABLE FILE FACT_ACTIVITY_CJ
SUM
	COMPUTE VAL1/I8 = CNT.ACT_ID;
        BY Year
WHERE PRODUCT_ID IN (93001,98002);
ON TABLE PCHOLD FORMAT HTML
END



How can i calculate count, if PRODUCT_ID = 93001 count is calculated from ACT_ID1
and PRODUCT_ID = 98002 count is calculated from ACT_ID2,
Final output should be the total count of both products.?

This message has been edited. Last edited by: FP Mod Chuck,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 229 | Location: MI | Registered: September 13, 2017Report This Post
Virtuoso
posted Hide Post
You need to create a define that tracks each value. Something like:
VAL1/I9=IF PRODUCT_ID EQ 93001 THEN 1 ELSE 0;
VAL2/I9=IF PRODUCT_ID EQ 98002 THEN 1 ELSE 0;

Then SUM VAL1 VAL2


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
quote:
ow can i calculate count, if PRODUCT_ID = 93001 count is calculated from ACT_ID1
and PRODUCT_ID = 98002 count is calculated from ACT_ID2,


BabakBYC solution is perfect and you can also try below ,

MAKE A DEFINE FILED AS NULL-ABLE AND DO COUNT
 
VAL1/I9 MISSING ON =IF PRODUCT_ID EQ 93001 THEN ACT_ID1 ELSE MISSING ;
VAL2/I9  MISSING ON  =IF PRODUCT_ID EQ 98002 THEN ACT_ID2 ELSE MISSING; 


Now you can do CNT.VAL1 and CNT.VAL2 .


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report This Post
Platinum Member
posted Hide Post
Hi,

I have tried using Define field as mentioned by you guys.
My scenario is bigger.
I will explain.
I am calculating count of products and showing it across month for year 2016 and 2017.
So when i do run the report i get output as below.
   
Product  Year  Jan Feb March ...
93001    2015   25  0    0
                 0  35    0
                ---------------
98001    2016    40  0    0
                  0  50    0


Because of that else condition it gives out put like that.


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 229 | Location: MI | Registered: September 13, 2017Report 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     [CLOSED] Different Count calculation for Column values

Copyright © 1996-2020 Information Builders