Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to make a document using macro.
But if I use a calculated dimension, It makes an error in changing the label.
How can I fix it ?
Thanks,
Wan Ki,
sub chartDraw
objs = ActiveDocument.ActiveSheet.GetSheetObjects
for i=lbound(objs) to ubound(objs)
if objs(i).GetObjectType = 12 or objs(i).GetObjectType = 16 then
objs(i).Close
end if
next
set Graph = ActiveDocument.ActiveSheet
set chart = Graph.CreateComboChart
chart.AddDimension "=if(YEAR<>'2015', YEAR)" ' "YEAR"
chart.AddDimension "MONTH"
chart.AddExpression "sum(Sales)"
chart.AddExpression "sum(MONTH)"
chart.AddExpression "sum(Sales)/100"
set p = chart.GetProperties
set di = p.Dimensions
di.Item(0).Title.v = "SUB_GRP" ' --> Error occurs.
di.Item(1).Title.v = "Date"
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ShowAsBar = false
expr.ShowAsLine = true
expr.ShowAsSymbol = true
expr.Label.v = "Sales"
set expr = p.Expressions.Item(1).Item(0).Data.ExpressionVisual
expr.ShowAsBar = false
expr.ShowAsLine = true
expr.ShowAsSymbol = true
expr.Label.v = "Count"
set expr = p.Expressions.Item(2).Item(0).Data.ExpressionVisual
expr.ShowAsBar = false
expr.ShowAsLine = true
expr.ShowAsSymbol = true
expr.Label.v = "Rate"
p.ChartProperties.MajorDimensionTextMode = 2 '
chart.SetProperties p
end sub
Hi,
have you seen this discussion?
http://community.qlik.com/message/30950#30950
Unfortunately, I tried as they suggest, but I didn't be able to solve the problem...
P{font-size:9pt; line-height:16; margin-left:0; margin-top:0;
margin-right:0; margin-bottom:0; font-family:굴림;}Hello,
I am very sorry about my delayed reply
My case us some deferent
Anyway tahno you so much for you reply
WanKi,
======================================================
(주)알인포스(Research & Information Services Co Ltd,)
SI 사업부 상무 / 전 완기(Jeon WanKi)
...maybe this one?