Column validation

More
1 month 2 weeks 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

Please Log in to join the conversation.

LimeSurvey Partners
More
1 month 2 weeks 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

Please Log in to join the conversation.

More
1 month 2 weeks 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.

Attachments:

Please Log in to join the conversation.

More
1 month 2 weeks 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 month 2 weeks 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
Attachments:

Please Log in to join the conversation.

More
1 month 2 weeks 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

Please Log in to join the conversation.

More
1 month 2 weeks 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
Attachments:

Please Log in to join the conversation.

More
1 month 2 weeks ago - 1 month 2 weeks 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
https://manual.limesurvey.org/ExpressionScript_-_Presentation#The_reserved_.22this.22.2C_.22self.22.2C_and_.22that.22_variables

Joffm





Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 1 month 2 weeks ago by Joffm.

Please Log in to join the conversation.

More
1 month 2 weeks 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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now