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.
I have a define field that is created by the following: IF "C&C Code" EQ 'VDIG01' THEN 'Digital Homes' ELSE IF "C&C Code" IN ( 'VPEXS' , 'VBEXS' , 'VNEXS' , 'VPBAS' , 'VBBAS' , 'VNBAS' , 'VDIG01' ) THEN 'Basic Subs' ELSE IF "C&C Code" EQ 'VPEXM' OR 'VBEXM' OR 'VNEXM' OR 'VPBAM' OR 'VBBAM' OR 'VNBAM' OR 'VPDIM' OR 'VNDIM' OR 'VBDIM' THEN 'EBU Room Count' ELSE IF "C&C Code" EQ 'VPDIS' OR 'VBDIS' OR 'VNDIS' OR 'VPDMX' OR 'VBDMX' OR 'VNDMX' THEN 'Digital Programming' ELSE IF "C&C Code" EQ 'VQD00' OR 'VQS00' OR 'VQMA0' OR 'VQSL0' OR 'VQTMI' OR 'VQTT6' OR 'VQTQU' THEN 'Set Top Boxes' ELSE 'UNKNOWN CATEGORY'
I then have another define field that gets a quantity using this: IF "Period" EQ d_prd AND "C&C Code" EQ 'SWDS1' THEN "Quantity" * 5 ELSE IF "Period" EQ d_prd AND "C&C Code" NE 'SWDS1' THEN "Quantity" ELSE 0
The issue is that when I use that define field and do a SUM, it not including the amounts from the Digital Homes category in the Basic Subs category. Both categories are created just fine, but the SUM isn't happening like I think it should. What have I done wrong?This message has been edited. Last edited by: FP Mod Chuck,
So, your field is Digital Homes if and only if C&C Code is VDIG01 but it's Basic Subs when it's one the 7 values you list (including VDIG01) which are essentially OR'd.
You have an overlap of values.
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
Correct, I knwo they overlap, I am trying to duplicate the results of an excel spreadsheet, however that is proving tough to replicate all the data manipulation that is possible in Excel here on this platform. I was basically reaching out to see if I was missing anything or if anyone knew how to get around it.This message has been edited. Last edited by: Trentj,
Hi, Do you want to create one column or multiple columns? Why I ask is because you want to count a field in both the catagories which is part of the same column.. that is a bit confusing. In your excel sheet is are all these Catagories different columns or rows of the same column? Any tool including excel will never evaluate Else part if the "IF" part is true..
that's the nature of IF ELSE statement..
WF 8.2.04 Windows/Unix All Formats In Focus since 2006
Posts: 74 | Location: UK | Registered: September 17, 2018
It creates both categories I am assuming due to the other codes in the basic subs. The Sum just omits it from the one category. That's why I am confused, the sum is what is omitting not the category. The sum has nothing in it besides looking for the one specific condition and in both basic subs and digital homes categories it falls within the ELSE condition, not the IF Also, it isn't a condition in Excel that is combining the two it's adding specific columns.This message has been edited. Last edited by: Trentj,
As I said earlier IF ELSE will check the conditions sequentially. If the condition is true for one statement it will not go and check the condition in the next statement irrespective if that is an IF or Else IF statement. You need to understand that if the condition is met for Digital Homes it will not go and evaluate the condition for Basic Subs. My assumption is with the help of the above statement you are either creating a Define or a Compute field. Even if you will use PRINT it will give you the same results as it can only assign one value to the field based on the condition.
WF 8.2.04 Windows/Unix All Formats In Focus since 2006
Posts: 74 | Location: UK | Registered: September 17, 2018
I am trying to duplicate the results of an excel spreadsheet
I think that based on previous different answer and above sentence you should ask yourself this :
What is the data source ? Is there any manipulation done on data prior to produce that Excel result ?
On the second one, it seems that the answer is yes. As per stated previously, you cannot have tow conditions meet within the same IF statement so, data has probably been manipulated.
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, 2013
Thank you to all. I understand why it isn't happening now (the digital homes category is for the VDIG01 only so when the SUM of my other define field is evaluated for that category, it is only counting the quantity for that code. Where the Basic Subs category, has all the other codes EXCEPT the VDIG01 cause it was evaluated in the DIGITAL HOMES category so the SUM for the second define field omits that field cause it doesn't exist in the first define field definition.) Sorry if this question drove everyone nuts, I just mainly wanted to make sure I wasnt missing anything. I have another format of the report where I have define fields for each of the categories, then I can sum the basic sub category and digital homes define fields to get a total field and that works. I just can't get the difference between the two period results to show below in an excel like fashion. thanks to all that replied and again I apologize if it seemed like such a noob question.
Welcome to Focal Point! No need to apologize that is what this forum is all about!
When a thread is done you can go back and edit your first post and change the summary to have the word [SOLVED} or [CLOSED] at the beginning so everyone knows there is some kind of resolution.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005