Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro limitations of 100 iterations?

Hi,

I have a macro solution that seemed to randomly stop and my original assumption was that it was caused by bad coding or bad data of some sort.

But, after quite a bit of trouble shooting it looks like QlikView limits my for-statement to 100 even if my selection amounts to 100+ field values.

Short version of the macro:

    Dim i

    for i = 0 to mySelections.Count - 1

    Dim FieldMainValue

    FieldMainValue = mySelections.Item(i).text

    ActiveDocument.Fields(FieldMain).Select FieldMainValue 

   Print_PDF FieldMainValue, "RP01"

   Next

Is anyone aware of any settings/limits that could be changed?

Kind regards

Niklas

1 Solution

Accepted Solutions
rubenmarin

Hi Niklas, maybe you assign values to mySelections using a function like GetSelectedValues, GetPossibleValues... those functions has a parameter to limit how many values you want to get and 100 is the default value.

You can set another number:

ActiveDocument.fields("FieldName").GetPossibleValues(1000, true)

View solution in original post

2 Replies
rubenmarin

Hi Niklas, maybe you assign values to mySelections using a function like GetSelectedValues, GetPossibleValues... those functions has a parameter to limit how many values you want to get and 100 is the default value.

You can set another number:

ActiveDocument.fields("FieldName").GetPossibleValues(1000, true)

Anonymous
Not applicable
Author

Amazing.

Was just about to check how many values that I had actually selected:

    set mySelections = ActiveDocument.Fields(FieldMain).GetPossibleValues

    Dim NrOfValues

  NrOfValues = "Number of selected values: " & mySelections.Count

  msgbox(NrOfValues)

And of course your were right.

set mySelections = ActiveDocument.Fields(FieldMain).GetPossibleValues(1000)


Thanks a lot!


Niklas