WHERE PERSON IS Sam and so on POSITION is PM and so on.
Might work
Leah
January 30, 2008, 02:10 PM
FrankDutch
Leah's solution is correct, but only if your database holds only one person per country per position. If you have more than one, you will only one of them.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
January 31, 2008, 03:25 AM
focuzsambit
That way column headers will come in a different way (read across field) But i need at same level...
nway, i have done in this way...
TABLE FILE B_SQL_PROJECTS
PRINT
DST.NAME AS 'PNAME'
DST.NUMBER AS 'PNUMBER'
DST.TYPEOFBUILDING AS 'CYEAR'
DST.TYPEOFCONSTRUCTION AS 'CMONTH'
COMPUTE ENAME/A70 = FIRSTNAME || '' || LASTNAME; AS 'ENAME'
-* COMPUTE DESG/A20= IF DEFGROUPID EQ '134' THEN 'PM' ELSE IF DEFGROUPID EQ '139' THEN 'OSR' ELSE IF DEFGROUPID EQ '124' THEN 'DM' ELSE IF DEFGROUPID EQ '125' THEN 'REM' ELSE IF DEFGROUPID EQ '136' THEN 'DPM' ELSE 'OTHER'; AS 'DESG'
DEFGROUPID
WHERE NUMBER EQ 'T212091' OR 'T211871' OR 'T212173' OR 'T202590';
-*WHERE READLIMIT EQ 1000
ON TABLE HOLD AS PCD1
END
-RUN
DEFINE FILE PCD1
PM/A70=IF DEFGROUPID EQ 134 THEN ENAME;
OSR/A70=IF DEFGROUPID EQ 139 THEN ENAME;
DM/A70=IF DEFGROUPID EQ 124 THEN ENAME;
REM/A70=IF DEFGROUPID EQ 125 THEN ENAME;
DPM/A70=IF DEFGROUPID EQ 136 THEN ENAME;
END
TABLE FILE PCD1
-* ENAME
SUM
PM
OSR
DM
REM
DPM
BY PNAME AS 'Project Name'
BY PNUMBER AS 'Project Number'
BY CYEAR AS 'Cycle Year'
BY CMONTH AS 'Cycle,Month'
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
END
SamThis message has been edited. Last edited by: focuzsambit,
I have to put the record straight here in case someone else sees this code and uses it.
This code itself is incorrect. The output can/will relate unrelated records.
Also this is easily done in one pass, no need for a hold file.
Alan. WF 7.705/8.007
January 31, 2008, 09:22 AM
Tony A
Thanks for the warning Alan, I was just about to use it ...... Not
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
January 31, 2008, 11:30 AM
Darin Lee
What is PRINT DST.NAME supposed to do? Using DISTINCT with PRINT is redundant since PRINT uses the lowest level of detail. DST is only valid with SUM.
Also agree that this is really the LONG SCENIC route.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
January 31, 2008, 11:32 AM
Alan B
PRINT DST. does actually work and is valid.
Try PRINT DST.BODYTYPE BY COUNTRY
Equivalent of BY COUNTRY BY MODEL.
The basic problem is the DEFINE in the second TABLE.
Alan. WF 7.705/8.007
February 01, 2008, 12:29 AM
focuzsambit
I am not looking at displaying the data...hence across is not the solution...i want to change the dimensions of the data...i want columns (PM OSR DM REM DPM)...
i think the define is not bringing data into one level...but sum/by is taking care of that in last print ??