Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to setup Cross Quota / Nested quota

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #230414 by Joffm
Replied by Joffm on topic How to setup Cross Quota / Nested quota
Yes, but if we had known that it is something like CATI, we would have seen a reason for your quota.

Okay, as promised, the easy solution.

1. Create a (hidden) question of type "equation" where you calculate a combined value of your two questions. (eqHidden)
To calculate you have to use numerical codes.
Now the equation is {(Q1-1)* _number of codes of Q2_ + Q2}
In a scenario with 4 answer option of Q1 and 3 answer options of Q2 -> {(Q1-1)*3+Q2}
You get a unique code of your 13 conmbinations.

2. Create a (hidden) question of type "list(radio)" with two answer options: (QQuota)
0 : Fine
1 : Quota Full

3. Create a (hidden) question of type "equation" where you set the value of the "list(radio)" with a nested IF-statement.
You see: If the value if greater or equal to your goal QQuota is set to 1, otherwise to 0.

This equation will be a long one, but it is easily to create in Excel or OpenOffice.

With this quota limits
 

(here linefeeds for clarification)
Code:
{QQuota=
if(eqHidden==1 and statCountIf(eqHidden.sgqa, 1) ge 3,1,
  if(QHidden==2 and statCountIf(QHidden.sgqa, 2) ge 1,1,
    if(QHidden==3 and statCountIf(QHidden.sgqa, 3) ge 3,1,
      if(QHidden==4 and statCountIf(QHidden.sgqa, 4) ge 4,1,
        if(QHidden==5,1,  /* This combination is always screened out */
          if(QHidden==6 and statCountIf(QHidden.sgqa, 6) ge 1,1,
            if(QHidden==7 and statCountIf(QHidden.sgqa, 7) ge 3,1,
              if(QHidden==8 and statCountIf(QHidden.sgqa, 8) ge 2,1,
                if(QHidden==9,1, /* This combination is always screened out */
                  if(QHidden==10 and statCountIf(QHidden.sgqa, 10) ge 5,1,
                    if(QHidden==11 and statCountIf(QHidden.sgqa, 11) ge 3,1,
                      if(QHidden==12 and statCountIf(QHidden.sgqa, 12) ge 1,1,0)
                    )
                  )
                )
              )
            )
          )
        )
      )
    )
  )
)
}
Adapt the values to your needs.

Now question "QQuota" is either "0" or "1" and you can set ONE quota on it -> screen out, if "1"


Joffm

And are you sure, you are using version 5.3.24. ?
The LimeSurvey hosted version 5.3.25. looks like this.
 

But this does not affect anything.

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: CX-HUB

Please Log in to join the conversation.

  • CX-HUB
  • CX-HUB's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 10 months ago #230427 by CX-HUB
Replied by CX-HUB on topic How to setup Cross Quota / Nested quota
You're really a Community master, Joffm! Super thanks for providing this detail!
I definetly will give it a go on my next project.

And yes - sorry - I'm using ver 5.3.25.

Keep up the good work!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose