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] Conditional Statement in a COMPUTE filed in Report and the BY FIELD

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Conditional Statement in a COMPUTE filed in Report and the BY FIELD
 Login/Join
 
Platinum Member
posted
Hi ,

I have a question.
I want to make sure ,whether the approach i am trying is correct or not.

I have a requirement where i have to calculate the counts of some event in the same category.
But event1 count logic is different than event2 count logic.

I created a HOLD file where i captured counts of events with no where clause.
Then used that HOLD file to filter for event1 and stored in a COMPUTE field. -- step 1 ---stored in a HOLD.
Used the same HOLD file to filter for event2 and stored in a COMPUTE field.--- step1 -- stored in a HOLD.
Then appended together using MORE command.

Can i do this in one go using an IF ELSE condition in step 1.

Also if i use IF ELSE ,
To which BY FIELD the calculation of IF ELSE is done?

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 can sometime do the following way, but without your requirement, difficult to say if it's a good option or not.
But since it does work the way you did it you can stay with that option. Doing in one step doesn't mean that it will be faster or better.

DEFINE FILE abc
event1 /P6 = IF cond EQ 'myFirstCond'  THEN 1 ELSE 0;
event2 /P6 = IF cond EQ 'mySecondCond' THEN 1 ELSE 0;
END
TABLE FILE abc
SUM event1
    event2
BY x
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
Platinum Member
posted Hide Post
I have different BY field conditions for calculating count(evene1) and count(event2)
For Ex : for calculating count(event1)
I have
 
BY LOWEST 1 COLUMN1
BY LOWEST 1 COULMN2
 


For count(event2) , i don't have to stick to that business rule.

So If i use IF ELSE ,how can i calculate for the BY FIELD conditions.
I am confused?

For which BY FILED the IF ELSE calculate to?I came across from someone that IF ELSE caculate to the LOWEST BY FIELD or FIRST BY FIELD.Any such thing?


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 229 | Location: MI | Registered: September 13, 2017Report This Post
Virtuoso
posted Hide Post
You may want to look at the following
TABLE FILE CAR
SUM CNT.MODEL AS 'NB_MODEL PER COUNTRY'
BY COUNTRY
SUM CNT.MODEL AS 'NB_MODEL PER CAR'
BY COUNTRY
BY CAR
END

But like I already stated, since it seems to be complicated, you may want to stay with your actual working option.
As we say : do not change a winning situation if it's not giving nothing more.


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
  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] Conditional Statement in a COMPUTE filed in Report and the BY FIELD

Copyright © 1996-2020 Information Builders