×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Jake,  

Your report was hard to read due to formatting but it appears you want to
"horizontally invert" your results.  

It may be a bit cumbersome but we have done this by using JDBC/SQL.  For
example:

Select sum(sales) as total, SUM ( case when state='AL' then sales else 0
END) as AL_Sales, SUM ( case when state='CA' then sales else 0 END) as
CA_Sales, .....  
>From X.Y
Group by division  


So the SQL case statement conditionally adds sales for each state and
creates a derived field for each state horizontally. Try it on a small
scenario to validate for your data.  It should work.  



Thanks,  Paul       

Business: 760-432-0600   Cell:  760-415-8830
PlanetJ - Makers of WOW  (AKA... WebSphere on Steroids)
You Need Web?  You Need WOW!  www.planetjavainc.com 
WOW!!!!


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of java400-l-request@xxxxxxxxxxxx
Sent: Wednesday, May 10, 2006 10:00 AM
To: java400-l@xxxxxxxxxxxx
Subject: JAVA400-L Digest, Vol 4, Issue 129

Send JAVA400-L mailing list submissions to
        java400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.midrange.com/mailman/listinfo/java400-l
or, via email, send a message with subject or body 'help' to
        java400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
        java400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of JAVA400-L digest..."

..
***********************************************************************
STAT DIV TOTAL
=============
AL    01    538.84
AR    01    986242.07
FL    01    1832.98
GA    01    1783.61
IL    01    166.30
IN    01    756.67
KY    01    556.02
LA    01    1279787.24
MO    01    81.34
MS    01    9322.18
NC    01    88.33
NM    01    1323.00
NY    01    870.71
OK    01    196140.16
SC    01    1047.48
TN    01    192.99
TX    01    2152351.44
VA    01    35.45
AL    02    547497.96
AR    02    219.95
AZ    02    319.31
CO    02    20370.00
FL    02    58478.53
GA    02    242.04
IL    02    13376.24
KS    02    2524.62
KY    02    14114.40
LA    02    1685708.81
MO    02    27212.36
MS    02    1050836.64
NC    02    35543.00
NM    02    87.67
NY    02    14452.80
OK    02    7214.37
SC    02    7984.18
TN    02    29600.54
TX    02    130007.98
VA    02    40989.60
***************************
I am trying to create a report in MS Excel which would produce a spreadsheet
like below..

                    TOTAL            AL          AZ
AR               CO         FL...........................
01            4631379.05         538.84     974478.56
02            451586.72                         451862.41     1563153.51
****************************************************************************
****************************
The above numbers are made up.....
I am thinking of associative arrays?  Could it be done without involving
associative arrays? Any input/suggestions regarding this problem would be
much appreciated.

Thanks in advance,

cheers,

Jake.
 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.