[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Looking for suggestions. Do I need an array?




The way I do these is to create an array that looks as much like my
report as possible.  So, in your case:

    Create-array name=week size=52              ! assuming 52 weeks/year
        Field=week:char                         ! maybe a number???
        Field=dept:char
        Field=day:number:7                      ! day occurs a possible
                                                ! 7 times

The total you can calculate by processing the array.  I often ignore the
zeroth element in arrays just to keep things simple cognitively.  If you
want to do this, specify day occurs 8 times instead of 7.  Day will be
referred to like so:

    Week(x) day(y)

So: put 2023 into week(27) day(4) gets it in and get #some_num from
week(27) day(4) gets it out.  I would probably load the weeks in first
then do the number crunching.

Richard Knapp
Database Programmer/Analyst
Institutional Research and Planning
University of Missouri System
573-882-8856
knappr@umsystem.edu
-----Original Message-----
From: sqr-users-bounces+knappr=umsystem.edu@sqrug.org
[mailto:sqr-users-bounces+knappr=umsystem.edu@sqrug.org] On Behalf Of
Deb Harris
Sent: Monday, December 13, 2004 12:48 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] Looking for suggestions. Do I need an array?

I have a problem of determining best to output a report and looking for
suggestions.  I very rarely work with arrays.  So I am not sure of how
to do it. 
 
I need to generate a report by a department, work week and the count of
records
Layout needs to be simular to the following. 
 
Rpt Dept      Mon         Tue        Wed        Thur    Weekly Total
 
Region Tot     18            10          3              3
34
South Am      10            10          2              2
22
East Am        8                           1              1
10
 
 
I never know how many departments or if a department will have a count
for a 
particular day.  I need to have a total of the number of records by day
and the weekly total appearing as the first line. 
 
Any help would be greatly appreciated. 
 
 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users