- Posts: 164
- Thank you received: 5
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
SUm and validate array column
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
2 years 11 months ago #216673
by brais24
SUm and validate array column was created by brais24
Hi People, I need to do something, I have 2 questions, a "P2" array text number, and a "P3" multiple numerical input.
The first column of P2 is to insert number of mans, and on P3 the number of mans should be the same of that column or less, and is not, show a message, i try to fo it putting this on ecuation validation question on P3
sum(self.sq_SQ001.NAOK)<=sum(that.P2.sq_SQ001.shown) AND sum(self.sq_SQ002.NAOK)<=sum(that.P2.sq_SQ002.shown)
And this on ecuation validation help on P3
{if(sum(self.sq_SQ001.NAOK)>sum(that.P2.sq_SQ001.shown),"O total de homes debe ser inferior ou igual " ,"")}
Looks like it works, but as you can see on the image, looks like only have in count the first digit, dont do the validation well
How can I do this please?
Thank you
The first column of P2 is to insert number of mans, and on P3 the number of mans should be the same of that column or less, and is not, show a message, i try to fo it putting this on ecuation validation question on P3
sum(self.sq_SQ001.NAOK)<=sum(that.P2.sq_SQ001.shown) AND sum(self.sq_SQ002.NAOK)<=sum(that.P2.sq_SQ002.shown)
And this on ecuation validation help on P3
{if(sum(self.sq_SQ001.NAOK)>sum(that.P2.sq_SQ001.shown),"O total de homes debe ser inferior ou igual " ,"")}
Looks like it works, but as you can see on the image, looks like only have in count the first digit, dont do the validation well
How can I do this please?
Thank you
Attachments:
The topic has been locked.
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 164
- Thank you received: 5
2 years 11 months ago #216674
by brais24
Replied by brais24 on topic SUm and validate array column
The topic has been locked.
- brais24
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 164
- Thank you received: 5
2 years 11 months ago #216675
by brais24
Replied by brais24 on topic SUm and validate array column
My LS version is 2.72.3+171020
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
2 years 11 months ago #216690
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic SUm and validate array column
Hi,
1. validation equation:
self.sq_SQ001.NAOK<=sum(that.P2.sq_SQ001.NAOK) AND self.sq_SQ002.NAOK<=sum(that.P2.sq_SQ002.NAOK)
2. validation tip (as you did it.)
{if(self.sq_SQ001.NAOK>sum(that.P2.sq_SQ001.NAOK),"O total de homes debe ser inferior ou igual " ,"")}<br/> {if(self.sq_SQ002.NAOK>sum(that.P2.sq_SQ002.NAOK),"O total de mulleres debe ser inferior ou igual ","")}
Joffm
1. validation equation:
self.sq_SQ001.NAOK<=sum(that.P2.sq_SQ001.NAOK) AND self.sq_SQ002.NAOK<=sum(that.P2.sq_SQ002.NAOK)
2. validation tip (as you did it.)
{if(self.sq_SQ001.NAOK>sum(that.P2.sq_SQ001.NAOK),"O total de homes debe ser inferior ou igual " ,"")}<br/> {if(self.sq_SQ002.NAOK>sum(that.P2.sq_SQ002.NAOK),"O total de mulleres debe ser inferior ou igual ","")}
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.