如果......我可以将切片机同步到另一台切片机吗? [英] Can I Sync a Slicer to Another Slicer If....

查看:76
本文介绍了如果......我可以将切片机同步到另一台切片机吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个切片器的数据源是一个excel表(过滤该表),另一个切片器的数据源连接到PowerPivot中的一个表(过滤数据透视表)。

One slicer's data source is an excel table (filtering that table) and the other slicer's data source is connected to a table in PowerPivot (filtering a PivotTable).

I已经链接了一个示例工作簿,其代码通常用于同步连接不在PowerPivot中的数据源的切片器;但是,在这种情况下,我得到一个..... " Application-define
或对象定义的错误"当我尝试运行代码时。

I've linked a sample workbook, with code that normally works for syncing slicers that are connected a datasource that is not in PowerPivot; however, in this case I'm getting an....."Application-define or object-defined error" when I attempt to run the code.

我试图这样做的原因是因为我不能"ShowDetails"。在由于MDX的限制而已按多个筛选条件筛选的PowerPivot表上。 

The reason I'm trying to do this is because I can't "ShowDetails" on a PowerPivot table that has been filtered by multiple filter criteria due to the limitations of MDX. 

https://www.dropbox.com/s/uqxxdgisr3rh18a/SyncSlicerProblem.xlsm? dl = 0

https://www.dropbox.com/s/uqxxdgisr3rh18a/SyncSlicerProblem.xlsm?dl=0

推荐答案

MarkDGaal,

Hi MarkDGaal,


VisibleSlicerItems 属性仅适用于基于工作簿的基于数据透视表的
切片器范围或列表( SlicerCache SourceType =
xlDatabase
,因此您无法将其用于其他来源。

The VisibleSlicerItems property is only applicable for slicers that are based on PivotTables based on workbook ranges or lists (SlicerCache.SourceType = xlDatabase), so you can’t use it for other sources.

解决方法是您可以获得 VisibleSlicerItemsList 属性值(格式如[CleanedData]。[RegionCode]。& [D]),然后拆分该值,之后你可以根据分割值(D)改变其他切片器。

The workaround is that you could get VisibleSlicerItemsList property value (format like [CleanedData].[RegionCode].&[D]), then split that value, after that you could base on the split value (D) to change other slicer.

Dim scLong As SlicerCache
Dim v As Variant

Dim wb As Workbook
Dim siLong As SlicerItem
Dim s As Slicer
Set wb = ThisWorkbook
Set scLong = wb.SlicerCaches("Slicer_RegionCode")
v = scLong.VisibleSlicerItemsList
Dim ss As String
ss = v(1)
MsgBox ss

问候

Starain


这篇关于如果......我可以将切片机同步到另一台切片机吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆