Welcome to the LimeSurvey Community Forum

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

Column validation

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 8 months ago #203568 by brais24
Column validation was created by brais24
Hi there people, i have a question related with Limesurvey, i dont know if its possible to do it, my limesurvey version is 2.72, and what I try to do is this.

I have 2 text array question that accept just numbers and show totals, like you can see on attached image, the questions is Q10 and Q11, I be able to validate that Q11 just accept as maximum value the total inserted on Q10, but now I want to do that with the columns, the column male from Q11 have to accept as maximum value the male value inserted on Q10, the same with the female, and the total validation have to stay.

I dont know if I explain me good, if you guys, need any more info or something, just tell it, ive been searching for the forum and dont find nothing related to this.

Thanks for the help.

Attachment not found

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #203570 by Joffm
Replied by Joffm on topic Column validation
Try to add your image again.

But I should say, either you validate in Q11 only the sums like
sum(self.sq_X001.NAOK)==sum(that.Q10.sq_X001.NAOK) AND sum(self.sq_X002.NAOK)==sum(that.Q10.sq_X002.NAOK)

or you validate that each cell of Q11 is less or equal the sum of Q10 like
self.sq_SQ001_X001.NAOK=<sum(that.Q10.sq_X001.NAOK) and
self.sq_SQ002_X001.NAOK=<sum(that.Q10.sq_X001.NAOK) and
self.sq_SQ003_X001.NAOK=<sum(that.Q10.sq_X001.NAOK) and
...
self.sq_SQ001_X002.NAOK=<sum(that.Q10.sq_X002.NAOK) and
self.sq_SQ002_X002.NAOK=<sum(that.Q10.sq_X002.NAOK) and
...

with X001, X002 the codes of your columns.

Better you attach a lss export.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 8 months ago #203676 by brais24
Replied by brais24 on topic Column validation
Hi Hoffm, thanks for the help, I attach the image again, if I dont understand you bad, I have to put that code on validation equation question, right?

I say it because I try to use it but the question dont validate nothing.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #203677 by tpartner
Replied by tpartner on topic Column validation

Joffm wrote: Better you attach a lss export.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 8 months ago #203678 by brais24
Replied by brais24 on topic Column validation
Here is both lss questions

File Attachment:

File Name: limesurvey...5837.lsq
File Size:7 KB

File Attachment:

File Name: limesurvey...5925.lsq
File Size:8 KB
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #203679 by Joffm
Replied by Joffm on topic Column validation
Hi, you attached an lsq export - only the questions.
We ask for a lss export - the survey.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 8 months ago #203680 by brais24
Replied by brais24 on topic Column validation
Thats right, I attach here, this is just a test survey to be able to do this.

File Attachment:

File Name: limesurvey...2893.lss
File Size:30 KB
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago - 3 years 8 months ago #203681 by Joffm
Replied by Joffm on topic Column validation
Hi,
you saw that I distinguished between the y-scale codes "SQ001", "SQ002" and the x-scale codes "X001", "X002"
sum(self.sq_X001.NAOK)==sum(that.Q10.sq_X001.NAOK) AND sum(self.sq_X002.NAOK)==sum(that.Q10.sq_X002.NAOK)

This way sum(self.sq_X001.NAOK) only sums up the columns with code "X001", but all rows.
sum(P11_SQ001_X001.NAOK, P11_SQ002_X001.NAOK)
,
If you enter sum(self.sq_SQ001.NAOK) you sum up
sum(P11_SQ001_SQ001.NAOK, P11_SQ001_SQ002.NAOK, P11_SQ002_SQ001.NAOK)
- everything that contains "SQ001".

Read about this here
manual.limesurvey.org/ExpressionScript_-....22that.22_variables

Joffm




Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 8 months ago by Joffm.
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 8 months ago #203691 by brais24
Replied by brais24 on topic Column validation
Ok, now I do it, the explanation and the link was so helpful.

Thank you Hoffm.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose