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     Column Order in report output

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Column Order in report output
 Login/Join
 
<Prabhu>
posted
Hi,

I am Prabhu and new to webfocus. I have one issue with column order/sorting. ie., I need to display "Total" column first. Now it displaying in last column. I generate Total column by COMPUTE statement. I tried but due to using of ACROSS column, I am not able to bring it to first. I attached the code below for your reference:

TABLE FILE TEST1
SUM
CNT1 AS 'Number'
RPCT.CNTP AS 'Percent'
BY ID AS '' NOPRINT
BY TEXT AS ''
ACROSS TOPCOL AS ''
COMPUTE Total/I8 = C1+C3; AS 'Total Number'

Plz help me to bring the computed Total column as first.

Thanks & Regards,
Prabhu.S
 
Report This Post
Platinum Member
posted Hide Post
See if this helps.
TABLE FILE CAR
SUM DEALER_COST
RETAIL_COST
COMPUTE TOT_COST/D12 = DEALER_COST + RETAIL_COST; AS 'Total Cost'
BY CAR
BY COUNTRY
ON TABLE HOLD
END
TABLE FILE HOLD
SUM TOT_COST
DEALER_COST
RETAIL_COST
BY CAR
ACROSS COUNTRY
END
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Guru
posted Hide Post
Is this what you want?

TABLE FILE CAR
SUM DC NOPRINT
RC NOPRINT
COMPUTE DIFF = C2 - C1;
DC
RC
BY CAR
ACROSS COUNTRY
END
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Platinum Member
posted Hide Post
Here's another way that I did it,


TABLE FILE BLAHBLAH
PRINT
F1
F2
F3
.
.
.
ON TABLE HOLD AS HOLDFILE FORMAT FOCUS INDEX F1 F2
END
DEFINE FILE HOLDFILE
-*
ALL_F1/I2 = -99;
END
-*
SQL
SELECT F1, F2, SUM(F3)
FROM HOLDFILE
GROUP BY F1, F2
UNION
SELECT ALL_F1 AS F1, F2, SUM(F3)
FROM HOLDFILE
GROUP BY ALL_F1, F2
;
TABLE ON TABLE HOLD AS HOLDFILE1 FORMAT FOCUS INDEX F1 F2
END
TABLE FILE HOLDFILE1
SUM
F2
F3
.
.
ACROSS F1
.
.
What I do is, since ACROSS places based on values, what I did was :
1. Select my records and HOLD it
2. Using SQL, I select the records from my hold file, grouping by the necessary fields and union it with a another select replacing the across field with Defined field with the value I want.
(in my example, I wanted F1 TOTAL to be the first column, so I gave defined it to be -99, a lower value than the data in the actual field. Now when I use Across, it will put that column first.)
3. Create and design report using your new across values.

This example is pretty lame as it's not really necessary. But suppose you had 5 columns you wanted summed or computed, Across doesn't work, with this method it will. And you decide where to put -99 will make it first, 99 will make it last, 50 will put it in the middle. (this is based on F1 being a numeric field between 1 and 100, but you get the idea!)

This message has been edited. Last edited by: <Mabel>,
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report 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     Column Order in report output

Copyright © 1996-2020 Information Builders