Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

How to get all values ?

I use the following script to get all possible values  in vb macro

SET Field1 = Doc.Fields("CodeGroupe").GetPossibleValues

How could I get all values possible and exluded for a field ?

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Or maybe something like

SUB Test

Set  field = ActiveDocument.GetField("FieldName")

msgbox( field.GetCardinal )

for i = 1 to field.GetCardinal

  msgbox(ActiveDocument.Evaluate("=FieldValue('FieldName',"&i&")"))

next

END SUB

View solution in original post

6 Replies
Highlighted
MVP & Luminary
MVP & Luminary

I think the easiest way will be to create these list within a variable in the gui per:

vList:

= concat({1} distinct Total CodeGroupe, ',')

and query them within the macro:

SET Field1 = Doc.Variables("vList").GetContent.String

- Marcus

Highlighted
Creator III
Creator III

vList:

= concat({1} distinct Total CodeGroupe, ',')

and query them within the macro:

SET Field1 = Doc.Variables("vList").GetContent.String

Highlighted
Contributor III
Contributor III

how could I loop over each values in the list ?

Highlighted
MVP
MVP

Or maybe something like

SUB Test

Set  field = ActiveDocument.GetField("FieldName")

msgbox( field.GetCardinal )

for i = 1 to field.GetCardinal

  msgbox(ActiveDocument.Evaluate("=FieldValue('FieldName',"&i&")"))

next

END SUB

View solution in original post

Highlighted
MVP & Luminary
MVP & Luminary

You could create an array from this variable and loop through it, like:

...

arr = split(Field1, ",")

for i = 0 to ubound(arr) - 1

     xyz = arr(i)

     ....

next

....

- Marcus

Highlighted
Contributor III
Contributor III

did a small qvw with a simple macro that works