[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Array Sort/Grouping Help
- Subject: Re: [sqr-users] Array Sort/Grouping Help
- From: "Mike Eischen" <MEISCHEN@genesco.com>
- Date: Thu, 29 Jan 2004 12:16:33 -0600
- List-id: This list is for discussion about the SQR database reporting language from Hyperion. <sqr-users.sqrug.org>
Hi Darrell,
I'm not sure I totally understand your requirements but I think something like
this might work...
What about creating a cursor or temp table, for storage of all the ID numbers
that you need
to summarize. Then traverse your original data, and for records that meet your
criteria,
either insert into the cursor or temp table, or if the ID already exists, add
the value to the total.
Then use the cursor or temp table to generate your report.
Hope this helps.
Mike
>>> darrel_1977@yahoo.com 01/29/04 11:46AM >>>
George -
I'm not sure if your solutions will help. Let me apologize in advance if they
do, but I can't see it.
My array already passes in the values I need. My problem is due to the way the
data is set up, I will obtain multiple IDs with my initially "summed up" NBRs.
I've tried every possible way I can think of to re-write my SQL to give me the
results I need, but to no avail.
So for every #ID in my array, I need to add the values from their cooresponding
#NBRs together. That new value (#NBR_SUM) along with the #ID will be then
printed to an output file.
In other words, rather than printing:
*********************
#ID: 001
#NBR: 123456
#ID: 002
#NBR: 987456
#ID: 003
#NBR: 555444
#ID: 001
#NBR: 000111
*********************
.....I need to see:
*********************
#ID: 001
#NBR_SUM: 123567 <--- NEW VALUE
#ID: 002
#NBR_SUM: 987456
#ID: 003
#NBR_SUM: 555444
*********************
I'm in the process of putting together a "bubble sort" as "The Dragon"
suggested. But I'm always open to other possibilities.
Thanks,
Darrel
George Jansen <GJANSEN@aflcio.org> wrote:
So you have
K1 -> S1 -> ID1, ID2 ...
S2 -> ID1, ID2
K2 -> S1 -> ID1, ID2 ...
S3 -> ID4, ID5...
....
Is it possible that you are approaching this the wrong way around?
Perhaps instead of build the IN lists you need a three-way join, and a
series of ON-BREAK procedures. This would allow you to
Failing that, what if you did a load lookup?
1. Create a view of the unique IDs--in Oracle terms this might be
CREATE OR REPLACE VIEW unique_b_ids
AS
SELECT id, rownum as rn
FROM (SELECT id from b order by id);
2. Code your load-lookup
load-lookup
name=b_ids
rows=????
table=unique_b_ids
key=id
return_value=rn
3. Then you can find out where in the array to stash your value (or add
it)
with
lookup b_ids #id #idx
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
_______________________________________________
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