# Can you use logic to determine number of statements in a matrix table?

Columbus, OHCommunity Member Qubie ✭

# Can you use logic to determine number of statements in a matrix table?

I'm creating a question in which I ask respondents to give me a numeric response to a question (How many [x] do you have?). Based on the number they select, I'd like to populate that same number of statements in a matrix table where the respondent can provide further detail about each individual [x].

I've yet to figure out a way to do this. My workaround currently is that if a user selects 1-5 for [x], they'll see a matrix with up to 5 statements. If they select 6-10 for [x], they'll see a matrix with up to 10 statements...

Hopefully that makes sense. If anyone has any insight that would be great!

If you are setting a limit in the first question this should be programmable. I would think there is javascript involved if you want the first number to be infinite. But say you use a text box for the first question (Q1) and let them enter 0-10 as a valid range.

Then for your matrix question you would do the following:
1. Question display logic -> Q1 > 0
2. Row logic
Row 1 -> display logic Q1 >= 1
Row 2 -> display logic Q1 >=2
....
Row 9 -> display logic Q1 >=9
Row 10 -> display logic Q1=10

Here's a good article in Qualtrics help that can explain more concisely and clearly. https://www.qualtrics.com/support/survey-platform/survey-module/question-options/display-logic/

I would set up your first question as a a Text Entry type and use the right hand menu to add the following validations:

• Force Response
• Content Validation
• Content Type = Number
• Numeric format -> Minimum = 0, Maximum = 0, Max Decimals =0

Then your matrix table would have 20 rows. You would add the question display logic (#1 in the link) and row display logic (section #2 in the link) as I had described in my first answer.

• Columbus, OHCommunity Member Qubie ✭

The first question would just be selecting a single number within a range of 0-20, so infinite is not necessary.

How would you define >= using qualtrics logic? The only explicit options in there that I can see are if/when a choice is selected/not selected or displayed/not displayed

• Madison, WICommunity Member, Product Ideas Superuser ✭✭✭✭

@jfedder88 if you want to keep this is a select list, then your row display logic gets bigger:

Row 1: when 1 is selected
Row 2: when 1 is selected + OR when 2 is selected
Row 3: when 1 is selected + OR when 2 is selected + OR when 3 is selected....