Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Chart Dimension through VBScript

Hi All,

I am new to Qlikview and trying to learn the scripting. My problem is that I have developed two charts on one sheet "Main" and both belongs to seperate Drill Groups..for example "LDI_WISE_GROUP" and "TOTAL_WISE_GROUP"

So an idea came in my mind to make one chart and set the group as dimension using VBScript Macros and trigger the macro via two buttons.

my code is the following

sub SetLDIDimensions
set chart = ActiveDocument.GetSheetObject("LDIChart")
chart.AddDimension("By_LDI_DrillDown")
end sub

sub SetTotalDimensions
set chart = ActiveDocument.GetSheetObject("LDIChart")
chart.AddDimension("By_Total_DrillDown")
end sub

Its keep on adding dimensions and upon clicking it says "Drawing of Chart failed internally" but when I press the "Clear" button from the toolbar it draws.

Second problem is that it doesnt remove the dimension rather it keeps on adding even though I've changed the code to the following but the problem is remain the same.

sub SetLDIDimensions
set chart = ActiveDocument.GetSheetObject("LDIChart")
chart.RemoveDimension 1
chart.RemoveDimension 2
chart.AddDimension("By_LDI_DrillDown")
end sub

sub SetTotalDimensions
set chart = ActiveDocument.GetSheetObject("LDIChart")
chart.RemoveDimension 1
chart.RemoveDimension 2
chart.AddDimension("By_Total_DrillDown")
end sub

I want my chart to be refreshed and show the data according to the group I want through buttons. what will be the code...thanks for the help.

1 Solution

Accepted Solutions
Not applicable
Author

Guys I have sorted out the problem..just added CLEAR method and its working...thanks

View solution in original post

1 Reply
Not applicable
Author

Guys I have sorted out the problem..just added CLEAR method and its working...thanks