Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
hedborg
Contributor

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

Re: Macro limitations of 100 iterations?

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)

2 Replies

Re: Macro limitations of 100 iterations?

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)

hedborg
Contributor

Re: Macro limitations of 100 iterations?

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