Sumatorys and alerts

More
1 month 1 week ago #229822 by brais24
Sumatorys and alerts was created by brais24
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.25
Own server or LimeSurvey hosting: Own
Survey theme/template: Fruity
==================
Hi people, i need help with a table I try to do, i have 2 issues on the table, i atach the lss of the survey.
First: I want to know if its possible to insert on a cell, the sum of another cells, i be able to do something similar putting this {sum(IP1_SQ001_SQ003.NAOK, IP1_SQ001_SQ004.NAOK)} on row name, but i want to see the sum and see how sum while you insert values on the cells marked in yellow on the attached screen called "captura" right down here 

Second: and more important because the first if is not possible to do i can manage using the method that i explain before, i need to put validations on the cells, for example, if i insert a value on the first column, i have to receive an error message but, if i insert a value on the last cell and on one of the 2,3,4,5 or 6 cell, the message should dissapear, looking for info i be able to do something similar on validation question putting this:

(is_empty(IP1_SQ001_SQ001.NAOK) or regexMatch('/^$/',IP1_SQ001_SQ001.NAOK))

And this on validation question help:
{if((is_empty(IP1_SQ001_SQ001.NAOK) or regexMatch('/^$/', IP1_SQ001_SQ001.NAOK)), '', 'Por favor, introduzca algo en descripción de los programas.<br />')}

Im sure this is possible to do but i dont know how to make it work correctly.

I put the idea on an image below.
 

Thanks for the help.
Attachments:

Please Log in to join the conversation.

More
1 month 1 week ago #229828 by Joffm
Replied by Joffm on topic Sumatorys and alerts
Two option for the validation:
1.
((is_empty(IP1_Y001_X001.NAOK)) or (!is_empty(IP1_Y001_X001.NAOK) and (!is_empty(IP1_Y001_X003.NAOK) or !is_empty(IP1_Y001_X004.NAOK) or !is_empty(IP1_Y001_X005.NAOK) or !is_empty(IP1_Y001_X006.NAOK) or !is_empty(IP1_Y001_X007.NAOK) or !is_empty(IP1_Y001_X010.NAOK)))) and
...
for all other rows

2.
(is_empty(IP1_Y001_X001.NAOK)) or (!is_empty(IP1_Y001_X001.NAOK) and (sum(IP1_Y001_X003.NAOK,IP1_Y001_X004.NAOK,IP1_Y001_X005.NAOK,IP1_Y001_X006.NAOK,IP1_Y001_X007.NAOK,IP1_Y001_X010.NAOK)>0)) and
...
for all other rows.

You see I coded the y-axis "Y001", "Y002", the x-axis "X001", "X002"

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 1 week ago #229831 by Joffm
Replied by Joffm on topic Sumatorys and alerts
And if you use a coding of the x-axis like
X001,X002,XA03,XA04,XA05,XA06,XA07,X008,X009,XA10
you are able to use "self" and "that" 

And the validation is
(is_empty(IP1_Y001_X001.NAOK) and sum(self.sq_Y001_XA.NAOK)==0) or (!is_empty(IP1_Y001_X001.NAOK) and (sum(self.sq_Y001_XA.NAOK)>0))
AND ...
for all rows.

I wonder why you use an array(text) though in my opinion you enter only numbers. Why not an array(numbers).
Now you have to validate too, that the entries are numeric.


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

Please Log in to join the conversation.

More
1 month 1 week ago #229867 by brais24
Replied by brais24 on topic Sumatorys and alerts
I'll try and let you know, thanks for the help.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now