check if item exist in olap cube

G

Guest

hi,

I have a pivot table report based on an olap cube, created by the pivot
table wizard. In my report, I have a page field called [date]. I want to
programmically add pageitems for display, based on a date range declared by
the user. This is my code:

activesheet.pivottables(1).pagefields("[Date]").currentpagelist =
Array("[date].[all date].[2002]","[date].[all date].[2003].[January]",
"[date].[all date].[February].[1]")

The problem is, if one of the items declared does not exist in the cube, an
error will be returned. Anyway I can exclude invalid items from the lsit or
to detect whether the items exist or not? By the way, I am unable to use the
PivotItems method to get the page items as it is from an Olap cube.

Thanks
 
G

Guest

this is what i did...
the simpler way...
when i create the olap cube, i tables to store the dimensions or fact tables.
I first do a database query to find whether the item exist or not before
using the currentpagelist function.
eg. for ur example, just do a select distinct date from the fact table to
find out whether the date exist or not first.

the more complicated way...
do a MDX query to the olap cube using ADOMD
eg.
select [Date].children as column....


rgrds,
James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top