Permutations - 8 columns
Since you're using a database, why not just let SQL do the work ?
select t.Period, t.account, t.currency, t.code, t.country,[other
columns here], sum(t.amount),average(t.amount)
from DataTable t
group by
t.Period, t.account, t.currency, t.code, t.country,[other column here]
Unless I misunderstand your explanation that should give you the
desired result.
Tim.
wrote in message
oups.com...
Hi,
I have gone through various posts in this group for the solution of
a
permutation I require but could not find one.
The data I have is as follows in eight columns
Col A Col B Col C Col D Col E ............ etc
Period Account Currency Code Country ....... etc
Nov-04 99700 USD 1234 USA
Dec-04 51000 2270 EUR
61000 2568 IND
38000
I need to have a macro which would give me a combination of data in
various columns into a database format. There can be additions to
the
information in some of the columns for eg. incase a new account is
created.
The output on another sheet needs to be as follows
for eg.
Col A Col B Col C Col D Col E ............ etc
Period Account Currency Code Country ....... etc
Nov-04 99700 USD 1234 USA
Nov-04 99700 USD 1234 EUR
Nov-04 99700 USD 1234 IND
Nov-04 99700 USD 2270 USA
Let me provide a background on why I am following this process since
if
someone has a better suggestion for arrive at the end result, I am
open
for it.
We have a database where all the financial information is stored. We
are not allowed to extract the information directly from the
database
in a tabular form. However using Excel retrieve I am allowed to
extract
the information based on various paramaters and unique variables of
each parameter is being listed by me as shown in the first table.
After having a permutation of various cols and parameters, I will be
adding an amount column which would provide the information
retrieved
based on the unique combination of 8 columns / 8 parameters.
Anyone's help is highly appreciated.
Regards
Sandip.
|