Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have generated a group with 4 fields like A,B,C,D.Now i want to create another group with same fields by using Macro function.Can any one help me how to do this.
I am attaching my qlikview file for ur better understanding.
Hi bharatkishore,
I think this macro example can be usefull,
sub copyGroup
Set gr = ActiveDocument.CreateGroup("GROUP2")
set gd = ActiveDocument.GetGroupDescription("GROUP1")
'Firstly we copy iscyclic property
gp = gr.GetProperties
gp.IsCyclic = gd.IsCyclic
gr.SetProperties gp
'Just add each field on GROUP1 TO GROUP2
set fdefs = gd.FieldDefs
for i = 0 to fdefs.Count-1
set fld = fdefs.Item(i)
gr.AddField fld.Name
next
end sub
Regars
Hi bharatkishore,
I think this macro example can be usefull,
sub copyGroup
Set gr = ActiveDocument.CreateGroup("GROUP2")
set gd = ActiveDocument.GetGroupDescription("GROUP1")
'Firstly we copy iscyclic property
gp = gr.GetProperties
gp.IsCyclic = gd.IsCyclic
gr.SetProperties gp
'Just add each field on GROUP1 TO GROUP2
set fdefs = gd.FieldDefs
for i = 0 to fdefs.Count-1
set fld = fdefs.Item(i)
gr.AddField fld.Name
next
end sub
Regars
Thanks Forte.