Discussion Board for collaboration on QlikView Scripting.
I see this sample in API Guide:
groups = ActiveDocument.GetGroups
set gp = groups(0).GetProperties
vars = gp.Labels
I want to know the total of groups in a document to do a loop. I'm trying something like this:
total = groups.Count
For i=0 to total-1
Set gp = groups(i).GetProperties
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
Go to Solution.
You can use Rob Wunderlich's Document Analyzer
You can download the analyzer from here http://qlikviewcookbook.com/recipes/download-info/document-analyzer/
here's one I found:
Macro: Loop over all groups?
Thanks sunindia! I check the analyzer and the following code works for me!
rem *** Extract groups from a Document object
'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)
& "," & csvQuote(groupType) _
& "," & csvQuote(fld.Name) _
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
Thanks for your help Jonathan! It works for me!
No Worries Daniel, and Thanks to the points you awarded, I am now a Wizard.
Yay!! Congratulations Jonathan Penuliar
Thank you sunindia