Focal Point
[CLOSED] adding more records to the table

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6467088376

December 11, 2014, 12:11 AM
Kamesh
[CLOSED] adding more records to the table
Hi,

I have to display 5 regions with 10 different codes. That means always I have to display 50 rows of data.

Ex:
Table 1:
1 BMW MODEL1
2 JAGUAR MODEL2
2 TOYOTA MODEL3
3 BMW MODEL1
3 TOYOTA MODEL3

I want the output to be

1 BMW MODEL1
1 JAGUAR MODEL2
1 TOYOTA MODEL3
2 BMW MODEL1
2 JAGUAR MODEL2
2 TOYOTA MODEL3
3 BMW MODEL1
3 JAGUAR MODEL2
3 TOYOTA MODEL3

How can I do this? Thanks for your help.

This message has been edited. Last edited by: <Kathryn Henning>,


WFConsultant

WF 8105M on Win7/Tomcat
December 11, 2014, 09:50 AM
George Patton
Look up:

RANKED BY
IN GROUPS OF


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
December 11, 2014, 10:04 AM
dbeagan
You're looking for all distinct combinations? Try this:

 TABLE FILE ibisamp/ggsales
 PRINT DST.REGION
 ON TABLE HOLD AS ggregion
 END

 TABLE FILE ibisamp/ggsales
 PRINT DST.PCD 
 ON TABLE HOLD AS ggpcd
 END

 SQL 
 select REGION, PCD
 from ggregion, ggpcd 
 ;
 TABLE ON TABLE HOLD AS cartesian
 END 
  
 TABLE FILE cartesian
 PRINT *
 END



WebFOCUS 8.2.06
December 12, 2014, 10:44 AM
susannah
sweet way to create a Cartesian product,db! beats manual McGyver-ing





In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 15, 2014, 05:16 AM
Dave
Good One


_____________________
WF: 8.0.0.9 > going 8.2.0.5
December 15, 2014, 12:00 PM
Danny-SRL
PRINT with DST? does this work?
I would think that you get all the rows and not all the values.
Using your idea with FOCUS code:
  
-* File dbeagan01.fex
TABLE FILE ibisamp/ggsales
 SUM 
 COMPUTE ONE/I1=1;
 BY REGION
 ON TABLE HOLD AS ggregion FORMAT FOCUS INDEX ONE
 END

 TABLE FILE ibisamp/ggsales
 SUM 
 COMPUTE ONE/I1=1;
 BY PCD 
 ON TABLE HOLD AS ggpcd FORMAT FOCUS INDEX ONE
 END

 JOIN ONE IN GGREGION TO ALL ONE IN GGPCD AS C
 TABLE FILE GGREGION
 PRINT REGION PCD
 END




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

December 16, 2014, 08:23 AM
dbeagan
Danny-SRL,

I like it. Might be preferred as a more pure FOCUS approach.


WebFOCUS 8.2.06