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     [SOLVED] Ordering Row Values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Ordering Row Values
 Login/Join
 
Platinum Member
posted
Hi,
I have a report as below.
  
Product   	Sales    Count
Product1  	xxx      zzz 
Product2  	yyy      rrr
Product3  	zzz      hhh
product4        bbb      nnn
product5        ccc      jjj
Total-A         aaa      vvv
Total-B         ddd      lll


Total-A should come after the row Product3 and Total-B should come as the last row.
I have used a sequence operation for ordering columns via GUI
Since i have used lots of hold files in my actual report i cannot open this in GUI.
Is there any way to give this sequence for Rows.

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
Since I don't know how your files have been created and because it think that you may have several hold files merged together, the easiest way is to create a row indicator for each.

Sample
TABLE FILE GGSALES
SUM DOLLARS
BY CITY
BY REGION
BY TOTAL COMPUTE TOTID   /I2  = 0;
BY PRODUCT
ON TABLE HOLD AS DETDATA
END

TABLE FILE GGSALES
SUM DOLLARS
BY CITY
BY REGION
BY TOTAL COMPUTE TOTID   /I2  = 2;
BY TOTAL COMPUTE PRODUCT /A16 = 'TOTAL';
ON TABLE HOLD AS TOTDATA
END

TABLE FILE DETDATA
SUM DOLLARS
BY CITY
BY REGION
BY TOTID NOPRINT
BY PRODUCT
MORE
FILE TOTDATA
END


But above can be accomplished with this

TABLE FILE GGSALES
SUM DOLLARS
BY CITY
BY REGION
BY PRODUCT
ON REGION SUBTOTAL
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
Virtuoso
posted Hide Post
srajeevan,
You don't say what Total-A and Total-B are.
Is Total-A the sum of Products 1,2,3 and Total-B the sum of 4,5?
If so, use a DEFINE:
  
DEFINE FILE myfile
T/A1=IF PRODUCT EQ 'Product1' OR 'Product2' OR 'Product3' THEN 'A' ELSE 'B';
END
TABLE FILE myfile
SUM SALES COUNT
BY T NOPRINT
BY PRODUCT
ON T SUBTOTAL
ON TABLE NOTOTAL
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
Danny-SRL

Nice Thread


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
Suppose i have the car file and i am displaying three countries sales(by applying filter) with Country name as first BY Field.
But i want to display those three countries in a specific order not alphabetically as wf does default.
I was hoping for a solution for that.
Daniel: I wont be able to use your solution as Total A and B is not subtotals ,it is another mathematical calculation.
MartinY: I will try your solution of giving a row indicator for each.But product 1 ,product 2 ,product 3 comes from master file and Total Field is a compute field.How can i give row Id for product 1 ,2,3.?Is it possible.


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 229 | Location: MI | Registered: September 13, 2017Report This Post
Platinum Member
posted Hide Post
Adding ROWS .. OVER .. to your BY will help to put the values in a specific order.

BY sortfield AS 'coltitle' ROWS value1 [AS 'text1']
OVER value2 [AS 'text2']
[... OVER valuen [ AS 'textn']]
END


WebFocus 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 168 | Registered: March 29, 2013Report This Post
Virtuoso
posted Hide Post
Srajeevan,

A possibility...
  
-* File srajeevan01.fex
DEFINE FILE CAR
PRODUCT/A20=IF CAR EQ 'JAGUAR' OR 'TOYOTA' OR 'DATSUN' OR 'AUDI' OR 'TRIUMPH' THEN CAR ELSE
            IF CAR EQ 'BMW' THEN 'TOTAL-A' ELSE 
			IF CAR EQ 'MASERATI' THEN 'TOTAL-B' ELSE ' ';
SEQ/I1=DECODE PRODUCT(JAGUAR 1 TOYOTA 2 DATSUN 3 'TOTAL-A' 4 AUDI 5 TRIUMPH 6 'TOTAL-B' 7 ELSE 0); 
Sales/I6 = IF SEQ EQ 1 OR 2 OR 3 OR 5 OR 6 THEN SALES ELSE
           IF SEQ EQ 4 THEN SALES * LOG(SEATS) + RCOST ELSE
		                    (WIDTH + HEIGHT) ** 2;
END
TABLE FILE CAR
SUM Sales CNT.Sales AS Count
BY SEQ NOPRINT
BY PRODUCT
IF PRODUCT NE ' '
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Another option to create row indicator.
My below sample has no sense, but it show the technic of using LAST and avoid of coding all possible values within a DECODE or IF.
But it may not be applicable. Each situation has its own solution.

TABLE FILE CAR
SUM RETAIL_COST
BY TOTAL COMPUTE ROWID /I2 = IF COUNTRY EQ LAST COUNTRY THEN ROWID ELSE ROWID + 1;
BY SEATS
BY COUNTRY
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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Ordering Row Values

Copyright © 1996-2020 Information Builders