作者:手机用户2502937447 | 来源:互联网 | 2023-05-17 09:34
IcreateaPivotTablewithaVBScriptinQLikView:我在QLikView中使用VBScript创建了一个Pivot表:subcleanUp()
I create a Pivot Table with a Vbscript in QLikView:
我在QLikView中使用Vbscript创建了一个Pivot表:
sub cleanUp()
set sheet = ActiveDocument.Sheets("Summary")
set summaryTable = sheet.CreatePivotTable
summaryTable.addDimension "Product Group Desc"
summaryTable.addDimension "Product Type Desc"
summaryTable.addDimension "Product Sub Group Desc"
summaryTable.addDimension "Country"
summaryTable.addDimension "ZoneMgrName"
summaryTable.addExpression "Sum({<[Fiscal Year]={$(vCurrentYear)}>}
[Sales Amount])"
set props = summaryTable.getProperties
set expr = props.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.Label.v = "Expenses $(vCurrentYear)"
expr.NumAdjust = 1 'center
expr.LabelAdjust = 1 'center
summaryTable.SetProperties props
end sub
In addition I would like to create new fields used as dimensions. These fields are not in my QLikView document so far. The value for these fields is linked to the value of other fields. Say I have a field Country in my Pivot Table. I would like to add a new Field "Area" which contains the name of the area which the country belongs to. So that the values for the field would be the return value of a function which returns the area for a given country.
此外,我还想创建用作维度的新字段。到目前为止,这些字段不在我的QLikView文档中。这些字段的值与其他字段的值相关联。假设在轴心表中有一个场域。我想添加一个新的字段“Area”,其中包含国家所属区域的名称。因此,该字段的值将是返回给定国家面积的函数的返回值。
1 个解决方案