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.
Can anyone please tell me how to separate -ve values or +ve values from a sum column/define/compute column.
i was trying by below wise
TABLE FILE TTTTT SUM TOT BY ID AS 'ID' BY Name AS 'Name' HEADING "Credit Balances Listing(All Students) As on" FOOTING "&DATEtrMDYY <+0> WHERE ( ENTRY_DATE GE DT(&EntryDate_From) ) AND ( ENTRY_DATE LE DT(&EntryDate_to) ) AND ( TOT LT 0 );
but when i was trying to do by that it is not separating the -ve values
Well, I don't know what +ve and -ve are but the first thing I would recommend is that you change the name of the field TOT to something else. TOT would be considered 'reserved' as it is a WebFOCUS prefix operator.
So let us call it for purposes of discussion ID_TOTS.
So then where you have AND (TOT LT 0), change this to:
I just want to write my query in clear way once again.
I have created one Define or compute field which contains negative values and positive values, so i want to show this define or compute field and also the new column with only negative values from the first define or compute field.
You really need to get some training or read the manuals, especially "Creating Reports with the WebFOCUS Language. Some of this is really basic stuff. Reading the manual will give you an idea of what you can do with the product.
Try this.
TABLE FILE TTTTT
SUM CURR_TOT
BY ID AS 'ID'
BY Name AS 'Name'
HEADING
"Credit Balances Listing(All Students) As on"
FOOTING
"&DATEtrMDYY <+0>
WHERE ( ENTRY_DATE GE DT(&EntryDate_From) ) AND ( ENTRY_DATE LE DT(&EntryDate_to) );
WHERE TOTAL CURR_TOT LT 0 ;
END
But to answer your question, if your verb is SUM, your COMPUTE will be summed. If your verb is PRINT, your COMPUTE will be printed.
If I understand you correctly, you want to have a column with the defined positive or negative value, and also a column with just the negative values. Is that correct? If so then consider the next example code:
DEFINE FILE CAR
DEFFLD1/D8 = IF SEATS LT 4 THEN -DCOST ELSE RCOST;
DEFFLD2/D8S = IF DEFFLD1 GE 0 THEN 0 ELSE DEFFLD1;
END
TABLE FILE CAR
PRINT CAR MODEL SEATS DEFFLD1 DEFFLD2
BY COUNTRY
END
TABLE FILE CAR
SUM CAR MODEL SEATS DEFFLD1 DEFFLD2
BY COUNTRY
END
Would this be of any help to you?
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007