Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I see this sample in API Guide:
groups = ActiveDocument.GetGroups
set gp = groups(0).GetProperties
vars = gp.Labels
msgbox vars(0)
I want to know the total of groups in a document to do a loop. I'm trying something like this:
groups = ActiveDocument.GetGroups
total = groups.Count
For i=0 to total-1
Set gp = groups(i).GetProperties
...
Next
But I don't how I can get the number of total groups in a QlikView document. I tried searching on API Guide but I didn't found anything.
Can anybody help me or know how I
You can use Rob Wunderlich's Document Analyzer
You can use Rob Wunderlich's Document Analyzer
You can download the analyzer from here http://qlikviewcookbook.com/recipes/download-info/document-analyzer/
Best,
Sunny
here's one I found:
Thanks sunindia! I check the analyzer and the following code works for me!
rem *** Extract groups from a Document object
Sub extractGroups(docObj)
'Dim groups, gp, i, j, fields, field, groupName
log "Extracting Groups"
groups = docObj.GetGroups
for i = lbound(groups) to ubound(groups)
set gp = groups(i).GetProperties
groupName = gp.Name
If gp.IsCyclic Then groupType = "Cyclic" Else groupType = "Drill"
set fields = gp.FieldDefs
for j = 0 to fields.Count-1
set fld = fields(j)
groupsFile.WriteLine( _
csvQuote(groupName) _
& "," & csvQuote(groupType) _
& "," & csvQuote(fld.Name) _
)
next
next
End Sub
I am glad it worked, but I think you should thank JPenuliar because he gave you the idea to use that, I just gave you the link to the place from where you can download it ![]()
Best,
Sunny
Thanks for your help Jonathan! It works for me! ![]()
No Worries Daniel, and Thanks to the points you awarded, I am now a Wizard.
![]()
Thank you sunindia