Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multidimensional arrays?

Status
Not open for further replies.

Hypermommy

Programmer
May 23, 2003
75
0
0
US
Can I use two-dimensional arrays in Crystal formulas using Crystal Syntax (can't really re-write the report right now and the previous developer used that instead of Visual Basic so it's time for me to learn it)? How do I declare the array? How do I redimension it as it needs to grow?

Thanks.

-= Hypermommy =-
 
Generally arrays are a last resort, perhaps you can share the intent, there may be another means.

Arrays are pretty basic, and there's info in the Help file.

Local NumberVar Array x := MakeArray (1, 1000, 10, 100, 10);

Re-size x to 10; values are retained
Redim Preserve x(10)

Nuke values and redim to 5
Redim Preserve x(5)

Return a value:

x[1]

You'd have to handle two dimensional arrays in code.

For more tailored results, post technical information when requesting it.

-k
 
Basically, I've been handed a report that is:

[tt]
0-6 days 7-30 days 30+ days
DDD BBB DDD BBB DDD BBB

Type 1 5 2 2 4 6 8
Type 2 2 6 2 5 7 9
[/tt]

Where the help desk tickets that belong to the DDD department are shown separate from those belonging to the BBB department. Now management wants another report that
displays the persons to which these aging tickets belong. Something like:

[tt]
0-6 days 7-30 days 30+ days
DDD BBB DDD BBB DDD BBB

John 3 0 1 0 4 0
Tim 0 1 0 1 0 4
Bruce 0 1 0 3 0 4
Type 1 5 2 2 4 6 8

John 1 0 1 0 4 0
Will 1 0 1 0 3 0
Bruce 0 4 0 3 0 4
Mike 0 2 0 2 0 5
Type 2 2 6 2 5 7 9
[/tt]


The report I was given sorts by ticket type. Then, as it's running the report, it has a print-time formula that looks at which department owns the ticket, figures out how old it is and puts the totals in the correct column based on ownership by department and age. But now they also want to look at who owns each ticket.

Also, the report I was given has a hardcoded variable (@variablename -- is that the right term for those that use the @) that reads each total that is computed in the print-time formula so it can be put on the report. For instance, they have @DDD6 and @BBB6 which represent the 6 day old tickets for the DDD department and the BBB departement respectively. They also have @DDD30 and @BBB30 and @DDD31 and @BBB31 (actually, they have a lot more -- the actual report has more columns becuase they break the aging up into more categories, but you get the general idea).

So... if I continue the logic that was previously used in the report I'll need @John6, @John30, @John31 and @Tim6, @Tim30, @Tim31 and so on and so on. First, the number of variables to keep track of would get crazy. Also, a change in employees (leaving or new hire) would require changing of the code.

So.. I thought instead of using the previous logic I would us an array that would basically read the name of the owner of the ticket, check the array to see if we'd already started subtotals for that owner, add another element if needed, do the subtotalling and then report the results. I'm not sure how I'm going to do it and thus was asking about arrays. But if that's not the best way to go, I'm very open to suggestions :)

Thanks all.

-= Hypermommy =-
 
I think that a report grouped by Type and by employee, and Running Totals with the date logic in the evaluate->use a formula might make more sense here, and reset at the employee group.

You would need another set for the type, but you definitely don't need formulas for each person nomatter how you handle it.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top