Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default check if item exist in olap cube

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default check if item exist in olap cube

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


"I.Soon" wrote:

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

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
Get OLAP cube name cottage6 Excel Discussion (Misc queries) 1 October 3rd 09 07:42 AM
OLAP Data Cube Hood Excel Worksheet Functions 0 August 21st 07 04:16 PM
suppress warning and locate cube in a pivot table from olap cube Tewari Excel Discussion (Misc queries) 0 March 28th 07 06:54 AM
olap cube little bear Excel Discussion (Misc queries) 1 February 16th 06 03:55 AM
#VALUE! from OLAP CUBE JPost Excel Programming 0 July 23rd 04 12:52 PM


All times are GMT +1. The time now is 05:46 PM.

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"