Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with Custom Extension

I played a bit with creating this document extension but haven't had a lot of success. This extension is specific to just one application so it doesn't matter if I hard-code in object and variable names. Here's an example:

  • QVW has 10 straight table charts.
  • I have created ten variables that are to contain the row count of each table, given any data selections.
  • The document extension keeps these ten variables updated with the current row count of each respective chart.

So the extension simply needs to inspect each chart, get the current row count, set the corresponding variable to that row count. Should be easy but I don't know how to do it.

1 Reply
Anonymous
Not applicable
Author

So this seems to work. If anyone can help optimize this, probably by using a loop, I'd appreciate it.

  var vDoc = Qv.GetCurrentDocument();

  var vCHTest1 = vDoc.GetObject("CHTest1");

  var vCHTest2 = vDoc.GetObject("CHTest2");

  var vCHTest3 = vDoc.GetObject("CHTest3");

 

  vCHTest1.SetOnUpdateComplete(function() {

  vRows = this.Data.TotalSize.y;

  vDoc.SetVariable("vCHTest1RowCount",vRows);

  });

  vCHTest2.SetOnUpdateComplete(function() {

  vRows = this.Data.TotalSize.y;

  vDoc.SetVariable("vCHTest2RowCount",vRows);

  });

  vCHTest3.SetOnUpdateComplete(function() {

  vRows = this.Data.TotalSize.y;

  vDoc.SetVariable("vCHTest3RowCount",vRows);

  });