- Posts: 52
- Thank you received: 4
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Show survey data total
- flasher44
- Topic Author
- Offline
- Senior Member
Less
More
5 years 7 months ago #174617
by flasher44
Replied by flasher44 on topic Show survey data total
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 7 months ago - 5 years 7 months ago #174630
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show survey data total
According to that logic file, the identifier for the first x-axis sub-question (first column) of Bird 1 would be 459729X34X336BI1_SQ001.
Bird 2 would be 459729X34X336BI2_SQ001.
...
Bird 2 would be 459729X34X336BI2_SQ001.
...
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 7 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 7 months ago - 5 years 7 months ago #174639
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Show survey data total
Or
then it's OK when you copy the survey …
: SGQA in lowercase see manual.limesurvey.org/Expression_Manager#Access_to_Variables at end of table.
Code:
{SPECIES_BI2_SQ001.sgqa}
: SGQA in lowercase see manual.limesurvey.org/Expression_Manager#Access_to_Variables at end of table.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 7 months ago by DenisChenu.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 7 months ago #174641
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show survey data total
Sure, but this is being done in a Twig file so probably:
Code:
processString('{SPECIES_BI2_SQ001.sgqa}')
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 7 months ago #174642
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Show survey data total
You're right …tpartner wrote: Sure, but this is being done in a Twig file so probably:
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 7 months ago - 5 years 7 months ago #174648
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show survey data total
@flasher44, so, if following your screenshot of the logic file, my original code should be something like this:
NOTE: all instances of sgqa should be in lower-case - see image below. (the forum is transforming the case in the code above)
Code:
<div> {% set bird1SGQA = processString('{SPECIES_BI1_SQ001.sgqa}') %} {% set aResponses = getAllTokenAnswers(aSurveyInfo.sid) %} {% set responseSum = 0 %} {% set responseCount = 0 %} {% set responseToken = '' %} {% for response in aResponses %} {% if (response[bird1SGQA] != '') %} {% set responseSum = responseSum + response[bird1SGQA]|number_format %} {% set responseCount = responseCount + 1 %} {% endif %} {% if (loop.index == 1) %} {% set responseToken = response['token'] %} {% endif %} {% endfor %} {% if (responseCount > 0) %} There are {{ responseCount }} valid responses for Q1 with token value {{ responseToken }}. <br /> The sum of all valid responses is {{ responseSum }}. <br /> The average of all valid responses is {{ (responseSum/responseCount) }}. {% endif %} </div>
NOTE: all instances of sgqa should be in lower-case - see image below. (the forum is transforming the case in the code above)
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 5 years 7 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- flasher44
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 52
- Thank you received: 4
5 years 7 months ago #174662
by flasher44
Replied by flasher44 on topic Show survey data total
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 7 months ago #174665
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Show survey data total
Especes_1_1 :
manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming
But it's always a bad solution to have sub question X and Y with only number
But it's always a bad solution to have sub question X and Y with only number
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 7 months ago - 5 years 7 months ago #174667
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show survey data total
Going by that screenshot, your variable definition for species 1 would be:
Species 2 would be:
And so on...
To avoid confusion, it is a good idea to assign the x-axis sub-question codes X001, X002,... And the y-axis codes Y001, Y002...
Species 2 would be:
And so on...
To avoid confusion, it is a good idea to assign the x-axis sub-question codes X001, X002,... And the y-axis codes Y001, Y002...
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 5 years 7 months ago by tpartner.
The topic has been locked.
- flasher44
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 52
- Thank you received: 4
5 years 7 months ago #174689
by flasher44
Replied by flasher44 on topic Show survey data total
It does not work … Is it because I have only numbers as x and y axis ?
The topic has been locked.
- flasher44
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 52
- Thank you received: 4
5 years 7 months ago #174691
by flasher44
Replied by flasher44 on topic Show survey data total
IT WORKS !!!!
Thank you so much for your help guys !!!
Thank you so much for your help guys !!!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 6 months ago - 5 years 6 months ago #174706
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Show survey data total
Phew!
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 6 months ago by tpartner.
The topic has been locked.