Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
nrehman
 
Posts: n/a
Default Pivot Table Cycling Through Page Fields Automatically

Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!

  #2   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:
Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Debra Dalgleish has some sample code at:
http://contextures.com/xlPivot09.html

I bet you could modify it to do what you want.

nrehman wrote:

Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!


--

Dave Peterson
  #4   Report Post  
nrehman
 
Posts: n/a
Default

Thank you! I should be able to adapt this code.

"Debra Dalgleish" wrote:

There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:
Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #5   Report Post  
nrehman
 
Posts: n/a
Default

This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:

There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:
Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




  #6   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:
This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:


There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:

Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #7   Report Post  
nrehman
 
Posts: n/a
Default

Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:

The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:
This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:


There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:

Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #8   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:
Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:


The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:

This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:



There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:


Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #9   Report Post  
nrehman
 
Posts: n/a
Default

Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different
from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:

You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:
Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:


The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:

This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:



There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:


Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #10   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

It should work with identical data, if you use UNION ALL in the SQL
statement.

nrehman wrote:
Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different
from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:


You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:

Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:



The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:


This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:




There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:



Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



  #11   Report Post  
nrehman
 
Posts: n/a
Default

Pure genius. It's a pleasure to know someone who has mastery of their art.

A capital thank you!



"Debra Dalgleish" wrote:

It should work with identical data, if you use UNION ALL in the SQL
statement.

nrehman wrote:
Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different
from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:


You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:

Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:



The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:


This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:




There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:



Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #12   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You're welcome! Thanks for letting me know that it worked.

nrehman wrote:
Pure genius. It's a pleasure to know someone who has mastery of their art.

A capital thank you!



"Debra Dalgleish" wrote:


It should work with identical data, if you use UNION ALL in the SQL
statement.

nrehman wrote:

Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different
from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:



You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:


Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:




The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:



This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:





There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:




Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #13   Report Post  
nrehman
 
Posts: n/a
Default

Progress is sometimes painful. After trying to decode the routine, I am
trying to add two capabilities to the cycling routine, but have had little
success (probably due to lack of both knowledge and correct implementation):

1) Include the "All" results
Here I would like to include the "All" results for each of the pagefields.
I have tried to modify the pivotitem For Next loops to start from "0", but
the code did not like this and crashes.

and

2) Exclude pagefields which create parameters for the data to cycle within.
Here I have have tried to modify the pagefield counts in multiple places,
but have not been successful. The idea was that if I could get the pagefield
count to be less than the number of pagefields (and the parameter pagefields
were placed below the cycling pagefields), then the parameter pagefields
would be ignored.

ANY suggestions?

Thanks you.

"Debra Dalgleish" wrote:

You're welcome! Thanks for letting me know that it worked.

nrehman wrote:
Pure genius. It's a pleasure to know someone who has mastery of their art.

A capital thank you!



"Debra Dalgleish" wrote:


It should work with identical data, if you use UNION ALL in the SQL
statement.

nrehman wrote:

Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different
from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:



You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:


Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:




The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:



This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:





There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:




Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #14   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

The code in one of my sample files may give you some ideas:

http://www.contextures.com/excelfiles.html

Under PivotTables, look for 'Pivot Page Spinner'


nrehman wrote:
Progress is sometimes painful. After trying to decode the routine, I am
trying to add two capabilities to the cycling routine, but have had little
success (probably due to lack of both knowledge and correct implementation):

1) Include the "All" results
Here I would like to include the "All" results for each of the pagefields.
I have tried to modify the pivotitem For Next loops to start from "0", but
the code did not like this and crashes.

and

2) Exclude pagefields which create parameters for the data to cycle within.
Here I have have tried to modify the pagefield counts in multiple places,
but have not been successful. The idea was that if I could get the pagefield
count to be less than the number of pagefields (and the parameter pagefields
were placed below the cycling pagefields), then the parameter pagefields
would be ignored.

ANY suggestions?

Thanks you.

"Debra Dalgleish" wrote:


You're welcome! Thanks for letting me know that it worked.

nrehman wrote:

Pure genius. It's a pleasure to know someone who has mastery of their art.

A capital thank you!



"Debra Dalgleish" wrote:



It should work with identical data, if you use UNION ALL in the SQL
statement.

nrehman wrote:


Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different

from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:




You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:



Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:





The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:




This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:






There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:





Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #15   Report Post  
nrehman
 
Posts: n/a
Default

Thanks! I will dig into it.
Regards,


"Debra Dalgleish" wrote:

The code in one of my sample files may give you some ideas:

http://www.contextures.com/excelfiles.html

Under PivotTables, look for 'Pivot Page Spinner'


nrehman wrote:
Progress is sometimes painful. After trying to decode the routine, I am
trying to add two capabilities to the cycling routine, but have had little
success (probably due to lack of both knowledge and correct implementation):

1) Include the "All" results
Here I would like to include the "All" results for each of the pagefields.
I have tried to modify the pivotitem For Next loops to start from "0", but
the code did not like this and crashes.

and

2) Exclude pagefields which create parameters for the data to cycle within.
Here I have have tried to modify the pagefield counts in multiple places,
but have not been successful. The idea was that if I could get the pagefield
count to be less than the number of pagefields (and the parameter pagefields
were placed below the cycling pagefields), then the parameter pagefields
would be ignored.

ANY suggestions?

Thanks you.

"Debra Dalgleish" wrote:


You're welcome! Thanks for letting me know that it worked.

nrehman wrote:

Pure genius. It's a pleasure to know someone who has mastery of their art.

A capital thank you!



"Debra Dalgleish" wrote:



It should work with identical data, if you use UNION ALL in the SQL
statement.

nrehman wrote:


Thanks again.

I created a new database query (the "Get Data" was trying to link to data on
a directory on your PC when I followed the instructions). Then created a new
SQL based on you SQL. This worked, creating a new pivot table which matched
your results.

I tried to do the same with some of my data, creating named regions for two
identical worksheets (say using Ontario and Alberta as the worksheet names).
However, I have the curious result of seeing ONLY ONE set of data (from one
named region) when the first column is identical in both of the worksheets
with data. When I change the first column in the Ontario to be different

from the first column in Alberta, I then see the two sets of data.

Do the first columns have to have different data (?). And therefore have to
have data that is unique to one worksheet as compared to the other? Is there
a step that I have missed in consolidating the data which causes identical
data to not be unioned?

Thanks!


"Debra Dalgleish" wrote:




You could use multiple consolidation ranges, but the results are too
good. There's an example, and a couple of workarounds, he

http://www.contextures.com/xlPivot08.html


nrehman wrote:



Thank you for your reply.

You are absolutely correct. Creating the identical parameters to cause the
same "bug", I found that I had created another variable which was crashing
the code. Once I removed that, the program ran fine (which is really great)!

I will be coming down to another wall soon, which the the maximum number of
rows (I have almost 65000 rows by 6 columns of data). Would you have any
ideas for how to work around this issue? Is there some way in the vb to
code/join two worksheets or range two sets of columns for a pivot table? (If
you prefer, I can submit a new item for the forum).

Thanks again for your invaluable help.

Nadir


"Debra Dalgleish" wrote:





The page field should allow more than 2000 items. What version of Excel
are you using?


nrehman wrote:




This worked great! Thank you.

However, as my sample has now expanded beyond a couple of hundred pivot
items. There are now over two thousand unique items and I am faced with the
error that effectively says there are too many items for the pivotitems
field. (I believe this is a function of the number of unique items by the
columns adding up to some number which cannot be exceeded).

Is there a work around? I would like to be able to generate the results for
all the items at one shot as it speeds the work and precludes human error.

Many thanks.



"Debra Dalgleish" wrote:






There's sample code here for printing each item in the page field:

http://www.contextures.com/xlPivot09.html

You could adapt that to your workbook.

nrehman wrote:





Hi. I am trying to cycle through a complete set of data in one of the
parameters in the "Page" field. For example, there are 500 investments, and I
want to compute the internal rate of return (IRR) for each investment based
on a series of cashflows for each investment.

The IRR is a function that is placed outside the pivot table. As each
investment number is chosen, the underlying pivot table cashflow data
changes, allow the IRR function to pick up these cashflows and compute the
IRR. However, if there are 500 investments, this becomes very time consuming
- especially if the underlying cashflow change constantly.

How could I cycle through the investments and copy the results from the IRR
to a separate table? (I can create the copy routine, but have not been
successful with the cycling through the pivot table page field).

Many thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table page field switch to (all) if my criteria is not avail Angus Excel Discussion (Misc queries) 0 July 30th 05 05:06 AM
Pivot Table page fields Chad W. Excel Discussion (Misc queries) 1 July 27th 05 04:27 PM
How to remove Drop Page Fields Here from Pivot Table wengyee Excel Discussion (Misc queries) 2 June 3rd 05 10:36 PM
How do I set up filter for page fields in pivot table? Mitsycat Excel Discussion (Misc queries) 3 May 6th 05 10:27 PM
Pivot Table Page Fields Andy Excel Discussion (Misc queries) 1 December 17th 04 05:25 PM


All times are GMT +1. The time now is 08:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"