Focal Point
Totalling across values.
July 17, 2007, 03:55 PM
HCallTotalling across values.
I have a report that is laid out with
Sales Rep, Division, Store,
and then an across of Dept (which has 4 unique depts).
for each store I have 2 unique rows, 'CP' and 'YTD'. I need a territory summary after each Sales rep, that will total for 'CP' and 'YTD' for each of the 4 depts. I can't figure it out. And BI support has yet to get back to me. Any geniuses out there that could help me?
WF 7.1.6 Platform Windows; Databases Informix, msSQL2000, msSQL2005, Unisys DMSII
Output HTML, EXCEL, PDF
July 17, 2007, 05:34 PM
smithsFrancis had a very good example a while back that might help...
https://forums.informationbuilders.com/eve/forums/a/tpc/...311078331#3311078331
------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
July 17, 2007, 05:40 PM
k.laneYou'll have to give a bit more info than that. Are the rows for CP and YTD done with an OVER or are they values that you can report from? I tried playing with the GGSALES table and found that I hit a roadblock when trying to come up with something.
If it's an OVER, then subtotal may do what you want.
Ken
Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Databases: Oracle 10g, SQL Server 2000, DB2.
July 18, 2007, 03:21 AM
Tony AKen has hit upon a solution for you and that is to use OVER on CP and YTD instead of sorting by them (if that is what you are doing?).
For an example we first have to get some data to mimic what I think yours might look like, and to do that I will use the McGyver method and then join to GGSALES as it has similar data to what you describe -
APP FI MCGYVER DISK MCGYVER.MAS (LRECL 80
-RUN
-WRITE MCGYVER
-WRITE MCGYVER FILE=MCGYVER,SUFFIX=FOC
-WRITE MCGYVER SEGNAME=SEG1
-WRITE MCGYVER FIELD=MCGYVER_KEY, ,A1 ,A1 ,FIELDTYPE=I, $
-WRITE MCGYVER FIELD=SUM_TYPE, ,A3 ,A3 ,$
-RUN
CREATE FILE MCGYVER
MODIFY FILE MCGYVER
FIXFORM MCGYVER_KEY/A1 SUM_TYPE/A3
DATA
CP
YTD
END
-RUN
JOIN MCGYVER_KEY WITH REGION IN GGSALES TO MULTIPLE MCGYVER_KEY IN MCGYVER AS J1
DEFINE FILE GGSALES
MCGYVER_KEY/A1 WITH REGION = ' ';
CUR_PERIOD/M = DATE;
-* Here I am trying to mimic two columns of data as per your post
CP/D20.2c = IF SUM_TYPE EQ 'CP ' AND CUR_PERIOD EQ 4 THEN DOLLARS ELSE 0;
YTD/D20.2c = IF SUM_TYPE EQ 'YTD' AND CUR_PERIOD LE 4 THEN DOLLARS ELSE 0;
END
TABLE FILE GGSALES
SUM CP
OVER YTD
BY PRODUCT PAGE-BREAK
BY CITY
BY STCD
ACROSS REGION ROW-TOTAL AS 'All Regions'
WHERE DATE FROM '19960101' TO '19961231'
ON PRODUCT SUBTOTAL AS 'Total for '
END
-RUN
Good luck
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 | |
July 18, 2007, 08:11 AM
HCallThanks for you input! I am not using an over. I have 2 separate records in a file I created. One for 'CP' and one for 'YTD'. I am usinga match to put the two records in the same file. I could change it and use the over and see if that works. Great ideas!
WF 7.1.6 Platform Windows; Databases Informix, msSQL2000, msSQL2005, Unisys DMSII
Output HTML, EXCEL, PDF
July 18, 2007, 12:30 PM
Francis MarianiT, this might be for you:
http://www.scaryideas.com/print/2960/ Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 18, 2007, 01:15 PM
Tony AThanks Francis, but I already have a few hundred of those tools and they really do have thousands of uses
my favorite is replacing Grannies crochet hook when she's put it down and can't remember where she left it - rofl
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 | |