Welcome to the LimeSurvey Community Forum

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

Array (Numbers) Subquestion validation

  • luis.d.gongora
  • luis.d.gongora's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 months 3 days ago #246056 by luis.d.gongora
Array (Numbers) Subquestion validation was created by luis.d.gongora
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
How can I validate that the sum of subtotals are less or equal to the Total in an Array (Numerics)?

I have a table with 2 rows and 3 columns:
 

So what's the best option to alert to a user that the sum of Subtotal1 + Subtotal2 is greather than the Total.
I tried writing a formula but it doesn't recognize the variables, so I don't know where to start looking:
 
 
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 months 3 days ago #246065 by Joffm
Replied by Joffm on topic Array (Numbers) Subquestion validation
Hi,

Why didn't you answer the initial questions about your version, etc.?

You have to use the correct QCODES to access the cells.
As described here
[url] manual.limesurvey.org/ExpressionScript_-...code_variable_naming [/url]

You have an array(numbers). So there are two axes of subquestions
Meaning:
Total of Spotify: Q1_SQ002_SQ001
Total of Facebook: Q1_SQ003_SQ001
Subtotal1 of Spotify: Q1_SQ002_SQ008
and so on.

I always advice to use different codes for y-axis ("Y001", "Y002",...) and x-axis ("X001", "X002",...) less confusion

Furthermore your function is wrong.
Read again here
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]

And at last: it is not a subquestion validation.
You have to use question validation and insert all rows.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose