+ Reply to Thread
Results 1 to 2 of 2

Olap Cubes - Automatic Select

Hybrid View

  1. #1
    Agamemnon
    Guest

    Olap Cubes - Automatic Select

    Hi,

    I would like to select a value in a pivot field automatically from
    information on a list box. My pivot table is built on an Olap Cube.

    I already have the following code for changing the pivot:

    ActiveSheet.PivotTables("Pivottable1").PivotFields("[MKT]").CurrentPageName
    = _
    "[MKT].[All].[NEW YORK]"

    Now I want the value chosen in the listbox to be used as a variable

    LTemp = CurList.List(CurList.ListIndex)

    ActiveSheet.PivotTables("Pivottable1").PivotFields("[MKT]").CurrentPageName
    = _
    "[MKT].[All].[LTemp]"

    But this doesn't work. Has anyone an idea if this is possible. I know it is
    with a "normal" pivot table but is it also possible with a pivot table based
    on an olap cube?

    Thx, for your answers


  2. #2
    Debra Dalgleish
    Guest

    Re: Olap Cubes - Automatic Select

    Use the & operator to incorporate the variable, e.g.:

    ActiveSheet.PivotTables("Pivottable1").PivotFields("[MKT]") _
    .CurrentPageName = "[MKT].[All].[" & LTemp & "]"



    Agamemnon wrote:
    > Hi,
    >
    > I would like to select a value in a pivot field automatically from
    > information on a list box. My pivot table is built on an Olap Cube.
    >
    > I already have the following code for changing the pivot:
    >
    > ActiveSheet.PivotTables("Pivottable1").PivotFields("[MKT]").CurrentPageName
    > = _
    > "[MKT].[All].[NEW YORK]"
    >
    > Now I want the value chosen in the listbox to be used as a variable
    >
    > LTemp = CurList.List(CurList.ListIndex)
    >
    > ActiveSheet.PivotTables("Pivottable1").PivotFields("[MKT]").CurrentPageName
    > = _
    > "[MKT].[All].[LTemp]"
    >
    > But this doesn't work. Has anyone an idea if this is possible. I know it is
    > with a "normal" pivot table but is it also possible with a pivot table based
    > on an olap cube?
    >
    > Thx, for your answers
    >



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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1